Upgrading an Application in Use

Comments

5 comments

  • Steven van Dijk

    I have this very simple powershell script that will fail the deployment if the specified process is running. Just put it in a powershell step at the beginning of your deployment:

    $Process = Get-Process notepad -ErrorAction SilentlyContinue
    
    if ($Process -ne $null) #if process exists
    {
        Write-Output "process running. Exiting"
        exit 1 #exit with error code 1
    }
    

    If you use the Powershell App Deployment Toolkit or anything else that needs to be interactive to the user, make sure that step runs as logged on user. (Options tab -> Run As)

    0
    Comment actions Permalink
  • Anon4343

    Running as a logged on user would be helpful, but it requires the user to have admin rights. With SCCM, the user can be a standard user.

    0
    Comment actions Permalink
  • Steven van Dijk

    Ah, right. Try running as Deploy user (interactive). That won't require your users to have admin rights, and will still run in an interactive shell and show messages to the logged on user.

    0
    Comment actions Permalink
  • Anon4343

    Oh thank you, I missed that detail.

    0
    Comment actions Permalink
  • Brandon Elliott

    The Powershell example above is definitely cleaner but here's a command prompt step that I use, just change the .exe both times. This example is what I would use for checking if Internet Explorer is running.

    tasklist /FI "IMAGENAME eq iexplore.exe" 2>NUL | find /I /N "iexplore.exe">NUL
    if "%ERRORLEVEL%"=="0" exit /b 1
    

    It could probably be simplified and cleaner but it works. A pro tip would be to put these "condition checker" steps into their own packages, and then in the future you can just put them in any package you want with a Nested Package step.

    0
    Comment actions Permalink

Please sign in to leave a comment.