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

Return value from a custom action

Hello,
I have InstallShield 2009. I need to run an executable in a custom action and according to the return value of the executable I need to reboot the computer or not. How can I use the exit code to trigger something else like a reboot?
Thanks
Labels (1)
0 Kudos
(5) Replies
RobertDickau
Flexera Alumni

I haven't tried it, but perhaps conditionally set the value of the REBOOT property based on the return value?
0 Kudos
atoncelli
Level 3

The ScheduleReboot sequence allows me to set a condition for the reboot. I guess I could set a variable according to what is the return value of the executable but the problem remains, how do I set a variable based on an executable return value?
If there isn't a solution to it I have the option of creating a file from the executable and read it. Even in this case I wouldn't know how to do it.
Thanks
0 Kudos
RobertDickau
Flexera Alumni

If an InstallScript custom action is an option, you can get an executable's return value using LaunchAppAndWait and LAAW_PARAMETERS.nLaunchResult, and then call MsiSetProperty to set the property to use in your condition; searching these forums for "LaunchAppAndWait" and "nLaunchResult" should turn up some code samples.
0 Kudos
KathyMorey
Level 10

What is the executable that you need to run? If you can set it up as an MSI dll, then could you set a property before it ends that matches the return code? If so, you could use that property to determine if a reboot is required.
0 Kudos
atoncelli
Level 3

I am building an MSI package. Could I run the executable within a function from a dll and use the return value that way?
Thanks
0 Kudos