This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Installscript exit code
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 27, 2012
05:23 AM
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.
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.
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 08, 2012
12:56 AM
There's no option to return custom exit or error codes from an InstallScript installation...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 08, 2012
08:21 PM
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 09, 2012
08:49 AM
Have you given up or found a solution? The other projects I work on can benefit from this if there's a way.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 09, 2012
01:58 PM
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;
// -----------------------------------------------------------------------
// OnAbort
//
// The OnAbort is called when a setup is aborted via the abort keyword.
// -----------------------------------------------------------------------
function OnAbort()
begin
Disable(LOGGING);
end;
![](/skins/images/8C9D13A71C7F7695F3262372C0172D68/responsive_peak/images/icon_anonymous_message.png)