Forum Discussion

ScottonTap's avatar
ScottonTap
Copper Contributor
Sep 21, 2021
Solved

intuneWin - adding powershell cmds to uninstall app before isntalling new

Having issues w/ superseded deployment with new app versions. 

 

Figured it might be easier to just deploy the new version and have PS run the uninstall of pre-existing first. 

 

If I want to have intunewin W32 package built I normally just point it to the setup.msi and go - works great. 

 

Any suggestions to do the following when building a W32 intunewin package

 

run PS and uninstall existing app (I have the msiexec /x string to uninstall the app. Then once removed (if not already there just proceed) and run the setup.msi for the upgraded app I want to deploy?

 

THanks,

 

 

 

4 Replies

  • Create a poweshell script

    First, I would "try" to check if the app is already installed and check if it has the right version you want to delete (I guess you could get that info from the registry) .
    "if" the conditions are met, I would try to kill the app first to be sure nothing is running, then run the msiexec /x uninstall string (of course test the uninstall string first)
    "else" install the app again with the msiexec silent switch

    Something like that?

    • ScottonTap's avatar
      ScottonTap
      Copper Contributor
      Thanks Rudy

      Was looking for instructions for running a .bat file as the setup file for intunewin

      Where the bat calls PS and deletes the file (I can do this)
      then calls the msi to install new - this I dont understand.

      If I want intunewin to run a PS script then run the installation? not clear how

      thanks

Resources