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

Installscript exit code

I'm wondering if anyone's had the need or desire, with Installscript, to return a specific exit code based on a condition in the script. I need to deploy a package to an environment through the available distribution facility. This distribution facility looks at the provided exit code to determine and report success or failure.

The Installscript package I've created has logic to run 5 separate installs and has code, in the script, to provide for pre-checks for an installation as well as verification after processing. But, even if I determine via the script that an error occurs (specific installation fails), the script will still exit with return code 0. For the distribution facility, this would be a success. What I would LIKE to do is on an error condition in the script, to exit the script and provide a non-zero return code. I've tried to search everywhere, but can't seem to find a useful solution.

Any help would be greatly appreciated.
Labels (1)
0 Kudos
4 Replies
rrinblue22
Level 9

There's no option to return custom exit or error codes from an InstallScript installation...
0 Kudos
glarsen
Level 3

Thanks. I didn't think so... but thought I'd inquire. I think I've managed to work around the issue by coding abort statements in my script when a verification of success encounters an error. By doing so, the script exits as a failure and is picked up by the distribution facility.
0 Kudos
DemonPiggies
Level 7

Have you given up or found a solution? The other projects I work on can benefit from this if there's a way.
0 Kudos
glarsen
Level 3

What I've done is code an abort in my script when installation success verification fails. Then, when being distributed, a failed exit code will be returned and reported to the distribution facility. In the script, I also include an OnAbort function so that logging will be disable (otherwise everything that was logged or installed will be reversed.

// -----------------------------------------------------------------------
// OnAbort
//
// The OnAbort is called when a setup is aborted via the abort keyword.
// -----------------------------------------------------------------------
function OnAbort()

begin
Disable(LOGGING);
end;
0 Kudos