问题
For installation, we have a property "Install" which we can use in conditions to execute if its undergoing installation. Do we have a similar property for Uninstallation?
回答1:
You can use REMOVE~="ALL"
to detect a full uninstallation.
An uninstall performed as part of a major upgrade can be detected via the UPGRADINGPRODUCTCODE property.
Here is some further advice and some help resources: here is a "MSI Conditions Cheat Sheet" to help you get the complicated MSI conditions for custom actions right. The sheet looks fine to me, but I have not tested it in detail - just sharing the link with your own testing as the only guarantee.
Also, you can check out Stefan Kruger's msifaq.com for a list of common MSI questions as well as his main installsite.org site for general deployment information.
With regards to Wix check out this well known wix tutorial. I'll throw in a link to the Windows Installer Best Practices list as well.
How to add a WiX custom action that happens only on uninstall (via MSI)?
来源:https://stackoverflow.com/questions/25253446/uninstallation-condition-for-wix