I have a WiX installer that has custom actions for each function that need to be performed when uninstalling. Right now I am having a problem when actions are performed regardless of whether this function was actually installed by the user. Custom actions fail because they expect certain resources to exist, and then the whole installation gets stuck in a broken state.
What is the correct way to trigger a custom action if and only if its associated function is removed? I have included the snippet that I use below if this helps.
<Custom Action="LaunchUninstallCustomAction" Before="RemoveFiles"><![CDATA[(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL") AND (&FeatureName<=2)]]></Custom>
windows-installer wix custom-action
dskiles
source share