Christopher Schene
asked on
Install shield LaunchAppAndWait is not picking up my return codes from .vbs scripts
I am running the attached Install shield function in Installshield professional 2008.
It is not picking up the return codes that I return from the .vbs script using the
WScript.Quit(-5)
method.
Any idea what is wrong?
It is not picking up the return codes that I return from the .vbs script using the
WScript.Quit(-5)
method.
Any idea what is wrong?
function NUMBER ProcessInstall(path, key, direction, drive, log)
STRING szDirectory, szProgram, CommandOptions, szCmdLine, vbscriptPath;
STRING sdirection, temp;
NUMBER result;
begin
szDirectory = TARGETDIR; //temp
LongPathToQuote (szDirectory,TRUE);
LongPathToQuote (path,TRUE);
NumToStr ( sdirection, direction);
szProgram = "cscript.exe";
CommandOptions = " -Drive " + drive + " -key " + key + " -dir " + sdirection;
vbscriptPath = TARGETDIR ^"\\ProcessInstall.vbs" ;
LongPathToQuote (vbscriptPath,TRUE);
szCmdLine =vbscriptPath + CommandOptions + " -p " + path;
//MessageBox("Install command line: " + szCmdLine ,WARNING);
result = LaunchAppAndWait ( szProgram, szCmdLine, WAIT);
return result;
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sure, only it has to be machine-wide environment, not user.
ASKER
Hi, If you can give me an example of reading an error code and error text from a file, I will add 200 points.
sorry, I'm not familiar with installsript.
HI cschene,
How did u fix your installshield problem? how did u get LaunchAppAndWait.htmto return your vb results? can u please let me know. THANKS...
How did u fix your installshield problem? how did u get LaunchAppAndWait.htmto return your vb results? can u please let me know. THANKS...
ASKER
I used a file to communcate errors between installshield and the VB application. I can upload the code if you wish.
what I am trying to do is to save the query result to a file by doing :
launchappandwait ("sqlcmd.exe", " -S serverip - d database -E /Q "select version from versiontable" > vlog.txt" , ....)
... check the result and openfile ...
it returns zero but the file is not there .. not sure why. could u upload your code so I see what am I missing ?
launchappandwait ("sqlcmd.exe", " -S serverip - d database -E /Q "select version from versiontable" > vlog.txt" , ....)
... check the result and openfile ...
it returns zero but the file is not there .. not sure why. could u upload your code so I see what am I missing ?
ASKER
What I believe happens is that you see a bad return (non zero) only if the command itself fails. So, I was running msiexex.exe and even if the >msi install failed, the msiexec command itself worked (it ran).
I will have to look around for the code
I will have to look around for the code
ASKER