Running uninstaller from code

I would like to add the β€œUninstall” button to my program that will start the uninstall to uninstall the program and then exit immediately. What is the best way: a) to determine if an uninstaller is present, and b) to find the correct uninstaller and run it?

Can I use the registry in reliable mode? I remember how I used the registry before to fix some bad installations and thought I could iterate over the entries and identify them, but I worry that using the registry might be unreliable and / or work on all systems?

Another thought is that I could actually store the removal information in the registry during the installation itself, and then use this information to somehow find the uninstaller you need. It seems like this would be the most reliable method, but is there an identifier that I could save so that I can then go back to the Windows installer?

+3
source share
1 answer

Windows, , MSI. , msiexec/x {ProductCode} . , / , , . UpgradeCode, API Windows, ProductCode .

+3

Source: https://habr.com/ru/post/1755648/


All Articles