Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] User Tips, Tricks and Samples
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-05-2019, 05:10 PM
deramor deramor is online now
Registered User
 
Join Date: 05-11-2011
Posts: 27
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.
Reply With Quote
  #2  
Old 03-05-2019, 06:36 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
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/scriptevents.htm

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.
Reply With Quote
  #3  
Old 03-06-2019, 06:04 PM
deramor deramor is online now
Registered User
 
Join Date: 05-11-2011
Posts: 27
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?
Reply With Quote
  #4  
Old 03-06-2019, 06:40 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 06:02 PM.


Copyright © 1999-2023 Kinook Software, Inc.