cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Happy_Days
Level 7

LaunchAppAndWait Return Value - Different Question

I am trying to launch an exe using LaunchAppAndWait which accepts .iss file as parameter. But no matter if iss is present or not, this function always return 0. Is there anyway to get the same return code which is written in the setup.log file if -f2 argument is also specified? Or, can we get some different return code if argument to this function is not valid etc.

Forget to add that I tried like this:

nResult= LaunchAppAndWait (MySetupFile, -s -f1"C:\Install.iss", LAAW_OPTION_WAIT | LAAW_OPTION_USE_CALLBACK);

And to track the return code, I use:
GetExitCodeProcess(LAAW_PROCESS_INFORMATION.hProcess, &iRetCode);
AND

NumToStr(RetCode,LAAW_PARAMETERS.nLaunchResult);

Still, no luck!

Please let me know if I am not clear. And BTW, due to some limitation I cannot use DoInstall function.

Regards
Labels (1)
0 Kudos
(4) Replies
RobertDickau
Flexera Alumni

The help topic "Setup.exe Return Values and Run-Time Errors (InstallScript Projects)" describes the values you can expect to get back; and as a test, you might try (independent of InstallShield) a batch file that launches setup.exe and then echoes the value of %ERRORLEVEL%...
0 Kudos
Happy_Days
Level 7

Thanks Robert for the reply, I tried it and that's also returning 0.
Probably I didn't put my questions well, I will try again:

I need to return the ResultCode from response log file from LaunchAppAndWait. Is that possible?

If not, is there any way I can do that apart from reading and parsing the setup.log file?

Pleae let me know. TIA.
0 Kudos
esiemiat
Level 9

The log file is really an INI file so you could use GetProfileString to read the result.
0 Kudos
Happy_Days
Level 7

Thanks Eric, I will give it a shot.

I still think there should be some function(s) to detect and return the values being set in the log file (not the launch codes). Don't you think so?
0 Kudos