I'm using Wix to code my own MSI installer. I need to run the custom action only before uninstallation of the product, but before any registry values or files are removed. I did the following (just to try):
<Property Id='CALC'>Calc.exe</Property>
<CustomAction Id='BeforeUninstall01' Property='CALC' ExeCommand='' Return='check' />
<InstallExecuteSequence>
<Custom Action='BeforeUninstall01' After='InstallInitialize'>Installed</Custom>
</InstallExecuteSequence>
It works if I choose to uninstall
from the Control Panel, but if I run my MSI instead (while it's already installed) the BeforeUninstall01
custom action is triggered anyway, which it shouldn't.
Any idea how to change this condition?