Sheritlw
03-20-2007, 02:33 AM
Hi, Well this is the code I came up with, but it's not downloading from my web. This is in the On Next event of the last form (Ready to Install).
What am I doing wrong? Thanks for your help
local bdbInstall = true;
local bKeyExists = false;
local bsql = false;
local bresult = false;
local bdb = false;
local bsuccess = false;
--sdbInstall = SetupData.GetPackageProperties("EZDB");
--bdbInstall = Database.Install;
if bdbInstall then
bKeyExists = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Microsoft SQL Server\\SQLEXPRESS");
if bKeyExists == false then
-- better check internet connection
result = HTTP.TestConnection("http://www.scheduleez-pro.com/", 20, 80, nil, nil);
if result then
--download sql express and database from our web
--SessionVar.Expand("%TempFolder%\\setup.exe"),
--"SQLDB.exe server:
bsql = HTTP.Download("http://www.scheduleez-pro.com/downloads/SQLEXPR32.exe",SessionVar.Expand("%TempFolder%\\SQLEXPR32.exe"), MODE_BINARY, 20, 80, nil, nil, nil);
result = Dialog.Message("dOWNLOADING", "ScheduleEZ was not able to download SQL Express. ", MB_OK, MB_ICONSTOP, MB_DEFBUTTON1);
if bsql then
bsql = File.Run(SessionVar.Expand("%TempFolder%\\SQLEXPR32.exe"), "", "", SW_SHOWNORMAL, true);
if bsql then -- we have installed sql server 'now lets download then db
bdb = HTTP.Download("http://www.scheduleez-pro.com/downloads/EZDB.exe",SessionVar.Expand("%TempFolder%\\EZDB.exe"), MODE_BINARY, 30, 80, nil, nil, nil);
if bdb then -- we have successfuly downloaded the db lets execute it
bsql = File.Run(SessionVar.Expand("%TempFolder%\\EZDB.exe"), "EZDB.exe server:.\SQLEXPRESS /database:ScheduleEZ /username:ezuser /password:ezez /quiet", "", SW_SHOWNORMAL, true);
if bsql then
bsuccess = true;
else
result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
end
else
result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
end
else
result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
end
else
result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
end
else
result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
end
else --- it is installed so lets just do db
bdb = HTTP.Download("http://www.scheduleez-pro.com/downloads/EZDB.exe",SessionVar.Expand("%TempFolder%\\EZDB.exe"), MODE_BINARY, 30, 80, nil, nil, nil);
if bdb then -- we have successfuly downloaded the db lets execute it
bsql = File.Run(SessionVar.Expand("%TempFolder%\\EZDB.exe"), "EZDB.exe server:.\SQLEXPRESS /database:ScheduleEZ /username:ezuser /password:ezez /quiet", "", SW_SHOWNORMAL, true);
if bsql then
bsuccess = true;
else
result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
end
else
result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
end
end
end
if bsuccess then
Screen.Next();
end
-- advance to the next screen
What am I doing wrong? Thanks for your help
local bdbInstall = true;
local bKeyExists = false;
local bsql = false;
local bresult = false;
local bdb = false;
local bsuccess = false;
--sdbInstall = SetupData.GetPackageProperties("EZDB");
--bdbInstall = Database.Install;
if bdbInstall then
bKeyExists = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Microsoft SQL Server\\SQLEXPRESS");
if bKeyExists == false then
-- better check internet connection
result = HTTP.TestConnection("http://www.scheduleez-pro.com/", 20, 80, nil, nil);
if result then
--download sql express and database from our web
--SessionVar.Expand("%TempFolder%\\setup.exe"),
--"SQLDB.exe server:
bsql = HTTP.Download("http://www.scheduleez-pro.com/downloads/SQLEXPR32.exe",SessionVar.Expand("%TempFolder%\\SQLEXPR32.exe"), MODE_BINARY, 20, 80, nil, nil, nil);
result = Dialog.Message("dOWNLOADING", "ScheduleEZ was not able to download SQL Express. ", MB_OK, MB_ICONSTOP, MB_DEFBUTTON1);
if bsql then
bsql = File.Run(SessionVar.Expand("%TempFolder%\\SQLEXPR32.exe"), "", "", SW_SHOWNORMAL, true);
if bsql then -- we have installed sql server 'now lets download then db
bdb = HTTP.Download("http://www.scheduleez-pro.com/downloads/EZDB.exe",SessionVar.Expand("%TempFolder%\\EZDB.exe"), MODE_BINARY, 30, 80, nil, nil, nil);
if bdb then -- we have successfuly downloaded the db lets execute it
bsql = File.Run(SessionVar.Expand("%TempFolder%\\EZDB.exe"), "EZDB.exe server:.\SQLEXPRESS /database:ScheduleEZ /username:ezuser /password:ezez /quiet", "", SW_SHOWNORMAL, true);
if bsql then
bsuccess = true;
else
result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
end
else
result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
end
else
result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
end
else
result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
end
else
result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
end
else --- it is installed so lets just do db
bdb = HTTP.Download("http://www.scheduleez-pro.com/downloads/EZDB.exe",SessionVar.Expand("%TempFolder%\\EZDB.exe"), MODE_BINARY, 30, 80, nil, nil, nil);
if bdb then -- we have successfuly downloaded the db lets execute it
bsql = File.Run(SessionVar.Expand("%TempFolder%\\EZDB.exe"), "EZDB.exe server:.\SQLEXPRESS /database:ScheduleEZ /username:ezuser /password:ezez /quiet", "", SW_SHOWNORMAL, true);
if bsql then
bsuccess = true;
else
result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
end
else
result = Dialog.Message("Notice", "ScheduleEZ was not able to download SQL Express. ", MB_ABORTRETRYIGNORE, MB_ICONSTOP, MB_DEFBUTTON1);
end
end
end
if bsuccess then
Screen.Next();
end
-- advance to the next screen