PDA

View Full Version : Store exit code in temporary macro


innomatics
09-23-2014, 10:59 PM
I would like to be able to store the exit code of the program command in a temporary macro during a build step.

This is so I can decide, based on the exit code whether to execute a future step.

For example, an installation returns with code 3010 to signal the install succeeded, but a reboot is required. I have added this exit code to the Success exit codes which is fine, but I think I need to set the temp macro to the exit code value in the post step event. Is this possible?

kinook
09-24-2014, 05:47 AM
Either

1) In the step's vbld_StepDone script event, store the value like so:

vbld_TempMacros.Add "TEMP_EXIT_CODE", vbld_TempMacro("RUNPROGRAM_EXITCODE").Value

http://www.kinook.com/VisBuildPro/Manual/scriptevents.htm
http://www.kinook.com/VisBuildPro/Manual/runprogramaction.htm
http://www.kinook.com/VisBuildPro/Manual/sysscriptmisc.htm

or

2) Add a Set Macro step following the step that runs the program and set a temp macro's value to %RUNPROGRAM_EXITCODE%

http://www.kinook.com/VisBuildPro/Manual/setmacroaction.htm

innomatics
09-24-2014, 06:35 PM
Thanks very much :)