I love the new File and Registry Exists/Does Not Exist conditions. If I can make a suggestion, I think a process running/not running condition would be very useful as well as a feature request.
Since we don't have this feature yet, I thought I'd share some scripts I'm using to work around this:
BAT to check for running process - fails (exit code 7) if running, passes if not (exit code 6):
FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE%"') DO IF %%x == %EXE% goto FOUND
EXIT /B 6
EXIT /B 7
Additional mods to step: Must add 6 as a success code. Otherwise, just change line 6 to "EXIT /B 0"
When I'm deploying Java, the above code isn't as useful, since there's a good chance someone will almost always be running either java.exe, iexplore.exe, and/or firefox.exe. So I found the following VBScript to prompt the user to consent to the update before it starts:
Set objShell = CreateObject("Wscript.Shell")
intReturn = objShell.Popup("Do you want to update java? All instances of IE and Firefox will be closed. Please save your work before clicking Yes. To cancel, click No.", 86400, "Update Java", 4 + 32)
If intReturn = 6 Then
ElseIf intReturn = 7 Then
Additional mods to step:
- Has to be an Install step pointed to the vbs file.
- Again, requires success code 6 be added.
- Custom command line has to be changed to cscript.exe //i "PromptToInstallJava.vbs" so that the user can see the prompt.
- Logged on State should be Only run if a user is logged on so you don't unnecessarily delay your deployment.
- Run As should be changed to Logged on User.
- I also set a custom timeout of 2160 minutes for the entire package so the user would have 24 hours to click Yes if they weren't able to run it right away.
Hope this helps someone else that wants to deploy with as little disruption as possible to the users!