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

setting exit code for install script

Hi all,

Is there a way to set the exit code for a install script? If the user is running silently, then I want to be able to use exit codes to notify the user of any failures. For example, when running silently and the application is running, I want to exit the installer with a specific error code.

Thank you in advance
Jeff
Labels (1)
0 Kudos
(3) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

There isn't any method available to control the exit code for InstallScript setups. The best option would be to write a return code out to a log file of some sort, and then parse the log file to determine the exit code. (Note that even in MSI installations the exit code can't be controlled to this extent; only predefined exit codes are returned depending on the way the setup exited, general failure, user abort, or success/reboot pending.)
0 Kudos
jeffyee
Level 3

Are we able to write to the same log file provided with the f2 command switch?

Thanks
Jeff
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

It would probably be possible to use the WriteProfInt and WriteProfString functions to write a custom section, keyword, and value to the log. However, the location of the log is not publicly available to script code. The location could possibly be passed with /z and read from the CMDLINE variable.
0 Kudos