cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rguggisberg
Level 13

How Do I Get Result From Bat File in CA?

Suppose I execute a bat file from a CA in a Basic MSI project.
Either by executing the Bat file as a CA or by executing it from an InstallScript CA.
How do I access the exit code returned (EXIT /B -1... for example) by the bat file?
Looks to me like the result for LaunchApp or LaunchAppAndWait is only the result for launching.
Thanks!
Labels (1)
0 Kudos
(1) Reply
rguggisberg
Level 13

Figured it out by researching the help and postings on this site and others.

LAAW_PARAMETERS.nLaunchResult has the result in the InstallScript... but to set it you need to do this in the bat file... assuming some decisions have been made, the desired return code is in %Ret%, and you jump to :LastLine. Putting this code somewhere else does not work (as was discovered by others).

REM Below required to be last line to pass exit code back to IS
:LastLine
%COMSPEC% /C EXIT %Ret% >nul

http://stackoverflow.com/questions/4632891/exiting-batch-with-exit-b-x-where-x-1-acts-as-if-command-completed-successfully
0 Kudos