Forcing actions to wait for the previous task to finish in a baseline

Hey guys, couldn’t quite find what I was after on this forum so thought I’d post and see what you guys think.
I’ve created a baseline to update Autodesk 2014/2015 products to 2017. The baseline has to uninstall the old products first, then install the 2017 products, and then remove the installation files (they were moved from __Download to a specific location in C: because the software needed to be installed from a static location that the deployment was created in).

The uninstall tasks run a batch file that’s been uploaded through software deployment (I couldn’t figure out how to encode appendfile files into ANSI) which work fine, but when the baseline gets up to the deployment tasks I have problems.

What is the best way to force the baseline to only start a task after the previous one has ended? At the moment I’m getting this:

Pending Restart             Deploy: Autodesk Mudbox 2017 
Failed                           Autodesk Restart Endpoint 
Not Relevant                 Deploy: Autodesk Maya 2017 
Failed                           Autodesk Restart Endpoint 
Not Relevant                 Deploy: Autodesk MotionBuilder 2017 
Failed                           Autodesk Restart Endpoint 
Not Relevant                 Remove Autodesk Maya 2017 Installation Files 
Not Relevant                 Remove Autodesk Mudbox 2017 Installation Files 
Not Relevant                 Remove Autodesk MotionBuilder 2017 Installation Files 
Not Relevant                 Remove Autodesk 3DS Max 2017 Installation Files 

My “Autodesk Restart Endpoint” task is really dumb (a simple “wait cmd /c shutdown -r -t 3600”), so I understand that IEM thinks the command has succeeded even though the computer won’t restart for another 59 minutes. But why does it jump from the Mudbox installer task that’s pending restart, to the Maya task that’s just sitting there?
The tasks are saying not relevant because I added “not pending restart” to the relevance, hoping that’d make it wait til my restart tasks before them happened.

Sorry about the huge post, I understand why this is happening but I just don’t know where to proceed.

1 Like

You have to make sure the each action doesn’t complete before all the work that its supposed to do is done. So if you know you’re calling something that doesn’t actually stay running while waiting to complete, like your shutdown command, then you need to put some other delay into your actionscript. Look at adding a pause while or another wait that runs something like ‘ping -t’ that won’t end until the reboot occurs.

1 Like

Thanks Steve, I’ll try that with “ping -n” so IEM doesn’t freak out about the action line suddenly ending.

@steve could you please post some example command to achieve the same, seems interesting as I never used pause & while.

Hey friends, I added this line to the end of each of my installer tasks:

pause while {exists running application "setup.exe"}

As well as this relevance:

not exists running application "setup.exe"

These lines allowed me to change the timer of my computer restart task to something sensible:

wait cmd /c shutdown -r -t 30

The restart tasks separate each installer task so the odds of an unrelated “setup.exe” running are slim.
Thanks for your help!

2 Likes

Generally you don’t want to do pause while like that. You should have some sort of timeout otherwise the BigFix agent will get stuck forever if the setup doesn’t close.

You can set a parameter to now and then check how much time has passed in the pause while in addition to looking for the application running. You can also look for processes that were spawned by the BESClient in addition to the process name, that way you are certain to only wait for the correct item.

2 Likes

I second @jgstew’s concern. You definitely want to be careful with pause while. There is a good thread by @JasonWalker with timeout examples here.

2 Likes