SCCM Detection Method for an App Uninstall

This worked great for me when I had to uninstall an app that had been deployed without an uninstall script added. The app was a fat install but was being replaced by an App-v version and I used this as a pre-req.

** Edit the strFile for the path to the file you want to use for the detection method. For the Mosaic example, the detection file is C:\Program Files\Entero Corporation\Mosaic2015.3\mosiac.exe.

To test, install your app locally, create a temporary collection, create a deployment to run the app to uninstall the local install.

2 responses to “SCCM Detection Method for an App Uninstall”

  1. mathken Avatar
    mathken

    Your method works, But I find it much easier to query HKLM:\….\uninstall for the application by display name. https://pastebin.com/UFZtnE3h

    Cheers,

    1. Scripters Avatar
      Scripters

      Hi Mathken,

      Your powershell script is great for the detection of an app by searching for the Uninstall key of the app. But the point of my post is to create a detection method for an app that’s been uninstalled by script and no longer exists on the machine. It’s the weird situation where you need to uninstall an app as a pre-req to installing a new version; supercedence won’t work because the previous install was done by SCCM Package. If it was added as an Application to begin with, I suppose you could merely edit the Deployment Type to add an uninstall script and update the package, and then supercedence would work, negating my need for a Pre-req Application to do the uninstall. But in my case the client had deployed all their apps by SCCM Packages. Another reason for using my method is if an app that was included in the OSD task sequence needed to be uninstalled. Cheers!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.