cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
john_straumann
Level 3

Return code from Setup.exe?

Hi all:

I need to be able to “get” the return code returned by the Setup.exe file itself, not any return codes that come from InstallShield scripts…has anyone out there ever done that?
I tried the following commands in a batch file but no luck…

Setup.exe /v"/l*v c:\install.log" echo %errorlevel% >> C:\Install.log
Setup.exe echo %errorlevel% >> C:\Install.log

Thanks in advance for any and all advice.

John.
Labels (1)
0 Kudos
(1) Reply
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

If you are launching these command lines from a command prompt or batch file, you will likely always get 0 as the return code, since this is actually the result of whether the process on the command line launched successfully or not.

Normally, the exit code for a process is accessed by an API such as GetExitCodeProcess. This requires a handle to the process (normally returned by the CreateProcess API).

If you can get the batch file to wait for the process to exit, this might set the error level to the process exit code.
0 Kudos