Uninstall any version.
Matt Ayres
Hi there... I am finding myself having to uninstall multiple varying versions of the same software... Creating a deploy package doesnt really save my time because there are so many different version!!
Is there no way to easily, from a dynamic collection of Application name contains.. Uninstall the application regardless of which version is installed?
0
Comments
This is for an MSIExec package btw
That's easy because a MSI package provides a uninstall string:
CMD Step:
Replace 'Adobe Flash Player%%' with 'your_application%%'
Example:
removes all C++ Versions like:
Microsoft Visual C++ 2005 Redistributable
Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729
Microsoft Visual C++ 2010 x86 Redistributable - 10.0.40219
Microsoft Visual C++ 2013 Redistributable (x64) - 12.0.40660
Microsoft Visual C++ 2015 Redistributable (x86) - 14.0.24215
It's generally not a good idea to use WMIC to uninstall programs like that. I'm having trouble finding the link I'm thinking of, but if I recall correctly WMIC reconfigures all applications when you do this. I recommend looking at our Uninstall packages in the Package Library. We enumerate the Registry to look for the GUID and pass that to MsiExec.
"We enumerate the Registry to look for the GUID and pass that to MsiExec."
Hi Colby,
that's excatly what WMIC does, looking for the uninstall string with the GUID from the registry and run him. Try it and look in the log file.
In therory you could use wmic to uninstall non msi packages too, but the missing individual /silent parameters are breaking a uninstall.
I talked to a coworker to clarify what I was trying to remember. It does reconfigure all applications (event ID 1035 in the Application log), but it's probably fine. There's a possibility of it messing with some timestamps and some poorly written applications may misbehave after being reconfigured. We call MsiExec with a GUID because it has fewer side effects.
Scripts help. I use this one for Java (sorry it's not up to date ATM). When a new version comes out, I just add the previous version to the top of the list.