PDA

View Full Version : Download from web, installing


Sheritlw
03-19-2007, 04:25 PM
I'm trying to make up a routine that will
1. Check if sql server installed
2. If not installed,
3. download sql express from my web, showing message of what it's doing.
4. If download successfull, download db showing message of what it's doing.
5. If successfull install sql express
6. If successfull install db

Below is what I have thus far, but if I know how to do the above, I will be able to figure out the rest.

Thanks, Sheri

local bdbInstall = false;

bKeyExists = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Microsoft SQL Server\\SQLEXPRESS");

if bKeyExists == false then

--download sql express and database from our web
HTTP.Download("http://www.scheduleez-pro.com/downloads/SQLEXPR32.exe","_TempFolder..", MODE_BINARY, 30, 80, nil, nil, nil);

-- download db
HTTP.Download("http://www.scheduleez-pro.com/downloads/EZDB.exe","%TempFolder%", MODE_BINARY, 30, 80, nil, nil, nil);

-- Install sql express
bsql = File.Run(_TempFolder.."\\SQLEXPR32.exe", "", "", SW_SHOWNORMAL, true);

-- install db
bsql = File.Run(_TempFolder.."\\EZDB.exe", "", "", SW_SHOWNORMAL, true);

else -- key exists so just download db

--- downlooad just the db
HTTP.Download("http://www.scheduleez-pro.com/downloads/EZDB.exe","%TempFolder%", MODE_BINARY, 30, 80, nil, nil, nil);

--- install db
bsql = File.Run(_TempFolder.."\\SQLEXPR32.exe", "", "", SW_SHOWNORMAL, true);

end

JXBURNS
03-19-2007, 06:19 PM
You are interspersing variables without (I think) understanding what they do

--download sql express and database from our web
HTTP.Download("http://www.scheduleez-pro.com/downloads/SQLEXPR32.exe","_TempFolder..", MODE_BINARY, 30, 80, nil, nil, nil);

Note that _TempFolder is already a string variable so if you are going to use it then the command would be

--download sql express and database from our web
HTTP.Download("http://www.scheduleez-pro.com/downloads/SQLEXPR32.exe",_TempFolder, MODE_BINARY, 30, 80, nil, nil, nil);

But then you change your method and use a %variable% which has not been expanded. %TempFolder% needs to be expanded so

-- download db
HTTP.Download("http://www.scheduleez-pro.com/downloads/EZDB.exe","%TempFolder%", MODE_BINARY, 30, 80, nil, nil, nil);

would become

-- download db
HTTP.Download("http://www.scheduleez-pro.com/downloads/EZDB.exe",SessionVar.Expand("%TempFolder%"), MODE_BINARY, 30, 80, nil, nil, nil);

The rest of the code needs changing accordingly but I would stick with either _TempFolder or %TempFolder% but not both as you will become confused.

John