|
#1
|
|||
|
|||
Retry a step conditionally
Hello. I would like to retry a step when it fails but only if the step originally failed with a specific exit code.
Sometimes when running Installshield steps, a license can't be retrieved. This errors with an exit code of 7159. I found this thread: https://www.kinook.com/Forum/showthr...?threadid=3887 however that doesn't have conditions on the retry logic. Any thoughts on this? I was thinking it could probably be done in the script editor for the step in question but I have no idea where to start there. |
#2
|
|||
|
|||
I was going to say, in the step's vbld_StepDone script event, do something like this:
Code:
Sub vbld_StepDone() ' get the exit code of the program exitCode = CLng(Application.Macros(vbldMacroAll)("RUNPROGRAM_EXITCODE").Value) ' treat anything but 7159 as success If exitCode <> 7159 Then Step.BuildStatus = vbldStepStatSucceeded End Sub https://kinook.com/VisBuildPro/Manual/scripteditor.htm https://kinook.com/VisBuildPro/Manua...gramaction.htm But that won't fail the step without retry for other non-zero exit codes. I think you would need to roll your own retry using the Loop action. |
#3
|
|||
|
|||
Is there a way to continue to loop given the value of a macro? Loop is limited by count or file contents but not a conditional statement.
Perhaps using the General tab to execute the step according to an expression. Then loop on a count so it doesn't run off forever. The resulting logic roughly would be: if(expression == TRUE && count < maxNumberOfLoops) do the loop endif Thoughts? |
#4
|
|||
|
|||
You can use the Exit action to end a loop.
https://kinook.com/VisBuildPro/Manual/exitaction.htm Or you can use a repeating build rule instead of a Loop action. https://kinook.com/VisBuildPro/Manual/buildrules.htm |
Thread Tools | |
Display Modes | Rate This Thread |
|
|