• Welcome to Support Forum: Get Support for Patch My PC Products and Services.
 

Uninstall program before uninstalling another

Started by Matthias Veelaert, March 21, 2022, 09:07:34 AM

Previous topic - Next topic

Matthias Veelaert

Hi,
I am looking for an option to be able to uninstall/remove an application before uninstalling another one but both have to be uninstalled automatically. The second fails to uninstall unless the first one is uninstalled before.

Kind regards!!

Adam Cook (Patch My PC)

I think this is similar to your other forum post. I think you'll need to be looking at a custom pre uninstall script. You could consider this community made script: https://github.com/PatchMyPCTeam/Community-Scripts/blob/main/Uninstall/Pre-Uninstall/Uninstall-Software/Uninstall-Software.ps1

You could attach your custom script as a pre-uninstall script to the app in our catalogue that you do want to uninstall.

https://patchmypc.com/custom-options-available-for-third-party-updates-and-applications#custom-scripts

Matthias Veelaert

Indeed its similar but I thought maybe this question might have given a different result seeing as maybe it was more of a general question now :P Thanks though for all your help already. I will indeed look into that script.
To execute the script, the PC on which patchmypc would execute it, should have executionpolicy bypass right? Or am I wrong about that? Thanks though :)

Adam Cook (Patch My PC)

It doesn't need to have execution policy set to bypass, only if your devices have an execution policy configured where they can only run PowerShell scripts if they're signed by a trusted certificate. More information here:

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies
https://adamtheautomator.com/how-to-sign-powershell-script/