0

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?

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
whihathac
  • 1,741
  • 2
  • 22
  • 38

1 Answers1

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)?

Community
  • 1
  • 1
Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • Thanks for the great explaination. Had tried REMOVE~=ALL, but it doesn't seem to work. – whihathac Aug 12 '14 at 18:52
  • Here's my condition which I am evaluating - Installed Or VCREDIST_INSTALLED Or REMOVE~="ALL" where VCREDIST_INSTALLED is evaluation if the VC++ redistr are already installed – whihathac Aug 12 '14 at 19:03
  • You must use ALL in quotes http://msdn.microsoft.com/en-us/library/aa368013(v=vs.85).aspx and keep in mind that if your product has features that can be added and removed it may be more useful to have a condition related to a feature being added or removed. – PhilDW Aug 13 '14 at 21:09
  • Thanks @PhilDW, I already had the quotes, but it doesn't work as intended yet. What do you mean by having a condition related to the feature? I need this check to block the installation/uninstallation from proceeding if VC++ is not installed – whihathac Aug 15 '14 at 21:10
  • How is the VCREDIST_INSTALLED property set? Remove that property temporarily and check if the remaining condition works as expected. – Stein Åsmul Aug 15 '14 at 22:33
  • The REMOVE syntax with ALL quoted is the correct condition, Glytzhkof is probable correct in suggesting that the vc redist property is the problem. – PhilDW Aug 18 '14 at 23:48