The function and capability of WAIT in the action language

(imported topic written by bdoellefeld)

I have a situation where an admin at a branch location has installed Office on hundreds of PCs using the wrong media (improper version). So in essence I need to replace the Office installation. In this case, Office 2000 Premium was installed when it was supposed to be Standard. I want to leverage BF to do this and I was hoping to get this packaged into one fixlet (or baseline) since having to follow-up an uninstall with an install is proving too difficult (tracking status, time between actions, failures, etc).

We are using Network install points and I was attempting to use the WAIT function. Here is an example I am using.

//Uninstall Prem
wait \\FS1L\Share\It\Repo\Microsoft\Office2000Prem\setup.exe /x "\\FS1L\Share\It\Repo\Microsoft\Office2000Prem\data1.msi" /qb-
//Install Stan
wait \\EWQLOVFIX1\Office2000Stan\setup.exe TRANSFORMS=\\EWQLOVFIX1\Office2000Stan\LOVELAND.MST /qb-
//Reinstall Outlook 2003 since add-ins are broken
wait msiexec /i \\EWQLOVFIX1\outlook2003\outls11.msi REINSTALL=ALL REINSTALLMODE=vomus /qb-
//Install 2007 compatibility pack
wait msiexec /qb- /i \\ewqlovfix1\Misc\Office2007_CompatibilityPack\O12Conv.msi

It doesn’t appear that WAIT works the way I thought it did, all installer routines start up near simultaneous.

How best can I handle this through BF?

Thanks!!

(imported comment written by jessewk)

The wait command will only wait for the initially launched process to quit. If the installer fires off a child process and then quits, the client will move on to the next action command without waiting for the child process to complete.

Most likely that’s what is happening here. To get the behavior you’d like, you can use the ‘pause while’ command to create custom criteria as to when the next action line should be executed.

One way we used to do this is here: http://forum.bigfix.com/viewtopic.php?id=1021

A better way if you are on 6.0 or higher is this:

Parameter “startClock”="{now}"

Pause while {() AND ((now - (parameter “startClock” as time)) < 20*minute)}

One important caveat… the line ‘Parameter “startClock”="{now}"’ will be evaluated before any lines of the action are run, regardless of where it is located in the action script. So you can either re-use it with a longer timeout for each installer launch, or use a different mechanism for tracking how long it’s been, such as writing time stamps out to a file, the registry, or a client setting.

Also note that it is important to guard your pause while relevance statements with some sort of timeout. Otherwise if something goes wrong and the pause while relevance never becomes false, the action will run continuously and the client will be unable to take other actions.

(imported comment written by bdoellefeld)

Question about reusing ‘Parameter “startClock”="{now}"’. Do I have to state this line repeatedly or just the “pause while” and increment the time so for instance…

Parameter "startClock"="{now}"
wait \\FS1L\Share\It\Repo\Microsoft\Office2000Prem\setup.exe /x "\\FS1L\Share\It\Repo\Microsoft\Office2000Prem\data1.msi" /qb-
Pause while ..... ((now - (parameter "startClock" as time)) <  5*minute)}
wait \\EWQLOVFIX1\Office2000Stan\setup.exe TRANSFORMS=\\EWQLOVFIX1\Office2000Stan\LOVELAND.MST /qb-
Pause while ..... ((now - (parameter "startClock" as time)) <  10*minute)}
wait msiexec /i \\EWQLOVFIX1\outlook2003\outls11.msi REINSTALL=ALL REINSTALLMODE=vomus /qb-
Pause while .....  ((now - (parameter "startClock" as time)) <  15*minute)}
wait msiexec /qb- /i \\ewqlovfix1\Misc\Office2007_CompatibilityPack\O12Conv.msi

Forgot to add. I want the relevance to be true for the parameter to enable the pause and false to proceed, correct?

Thanks!

(imported comment written by jessewk)

bdoellefeld

Question about reusing ‘Parameter “startClock”="{now}"’. Do I have to state this line repeatedly or just the “pause while” and increment the time so for instance…

Looks like you’ve got it right. Only need to set it once.

bdoellefeld

Forgot to add. I want the relevance to be true for the parameter to enable the pause and false to proceed, correct?

Correct.

(imported comment written by bdoellefeld)

Tried the action and got a failure. Any ideas?

Completed parameter "startClock"="{now}" 
Completed wait \\FS1L\Share\It\Repo\Microsoft\Office2000Prem\setup.exe /x "\\FS1L\Share\It\Repo\Microsoft\Office2000Prem\data1.msi" /qb- 
Failed pause while {(exists key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{00000409-78E1-11D2-B60F-006097C998E7}" of registry ) AND ((now - (parameter "startClock" as time)) < 5*minute)}

(imported comment written by jessewk)

Yes, you need to escape your curly brace:

{(exists key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{{00000409-78E1-11D2-B60F-006097C998E7}” of registry ) AND ((now - (parameter “startClock” as time)) < 5*minute)}

(imported comment written by bdoellefeld)

Still failing, I even dropped it to

{(now - (parameter “startClock” as time) < 5*minute)}

And it still fails.

(imported comment written by bdoellefeld)

Added a curly brace

{(exists key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{{00000409-78E1-11D2-B60F-006097C998E7

}

}" of registry ) AND ((now - (parameter “startClock” as time)) < 5*minute)}

now it does not fail but it also doesn’t wait, or at least it does not wait the required 5 minutes?

(imported comment written by jessewk)

This should work if you’d like to pause until the uninstall key no longer exists or 5 minutes have passed:

parameter “startClock”="{now}"

wait \FS1L\Share\It\Repo\Microsoft\Office2000Prem\setup.exe /x “\FS1L\Share\It\Repo\Microsoft\Office2000Prem\data1.msi” /qb-

pause while {(exists key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall%7B00000409-78E1-11D2-B60F-006097C998E7%7D” of registry ) AND (now - (parameter “startClock” as time) < 5*minute)}