Reputation: 2321
I have my application that will install another application. This is easily done by running that application's setup.exe with ShellAPI in my program.
However if this external application already exists, I would like to uninstall it first. I can do this myself by opening the Control Panel, finding the application, and then there is some menu options for "Uninstall" or "Repair." Clicking either one will open an InstallAware Wizard for this application.
Can I launch this wizard from my application? The user will still have to click through and confirm everything, but I'm trying to consolidate the steps needed to uninstall and reinstall a fresh/newer version of this external application. I cannot find any thing like an uninstall.exe thing to run. What is executed from the Control Panel link to Uninstall an application?
Upvotes: 0
Views: 1202
Reputation: 28519
You can find list of installed applications under registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
Each application has its own sub-key so you will have to find correct one. Uninstall information is then stored under UninstallString
value.
There is also possibility that application is installed under HKEY_CURRENT_USER
root key.
However, I would not recommend that you perform un-installation yourself, unless you have some specific reason to do so. Any decent installer should be able to perform upgrade of existing installation, so calling setup.exe
should suffice.
Upvotes: 2