开发者

How do you execute a custom action in WiX only if an installed feature is being uninstalled?

开发者 https://www.devze.com 2022-12-19 12:16 出处:网络
I have a WiX installer that has per-feature custom actions that need to be executed on uninstall.Right now I\'m running into a problem where the actions execute whether or not the feature was actually

I have a WiX installer that has per-feature custom actions that need to be executed on uninstall. Right now I'm running into a problem where the actions execute whether or not the feature was actually installed by the user. The custom actions fail because they expect certain resources开发者_Python百科 to exist and then the entire install is stuck in a broken state.

What is the correct way to run a custom action if and only if its related feature is being uninstalled? I have included the snippet that I'm currently using below, if it helps.

<Custom Action="LaunchUninstallCustomAction" Before="RemoveFiles"><![CDATA[(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL") AND (&FeatureName<=2)]]></Custom>


Try

<Custom Action="LaunchUninstallCustomAction" Before="RemoveFiles">
   <![CDATA[(NOT UPGRADINGPRODUCTCODE) 
             AND (&FeatureName=2) AND (!FeatureName=3)]]>
</Custom>

See MSDN for details of condition syntax and examples


It sounds like the custom actions are broken and not handling missing resources correctly.

How would the CA's handle it if a user manually removes files? What happens if a user deletes the application folder, and then tries to remove it via ARP?

What happens if a user just removes a feature, without uninstalling the entire application? You'll be better off long-term fixing the CA's.

0

精彩评论

暂无评论...
验证码 换一张
取 消