Hello,
Every product that properly installs on the system, i.e having an entry in the "Add/Remove Programs", will have a registry entry under the following key:
Code: Select all
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
This key contains a list of GUIDs (for .msi based installers) or keys that are named after the installed product. Each of these keys contain an UninstallString value which holds a path+command line paramaters that initiate that certain product's uninstallation. This is the place where you should search for the UninstallString of your prerequisite. You will probably want to search for the QuietUninstallString first to initiate a quiet uninstall if this is supported by the prerequisite.
Please note that users may already have had your prerequisite installed before they installed your application. They may not want you to uninstall the prerequisite. You should notify them somehow that you are going to uninstall it along with your product, and give them the choice to prevent that. You can check out our comprehensive guide
How do I uninstall another MSI package when my application is uninstalled for more details on how to achieve this.
Regards,
Gabriel