How to add a WiX custom action that happens only on uninstall (via MSI)?

后端 未结 6 1291
一生所求
一生所求 2020-11-22 06:20

I would like to modify an MSI installer (created through WiX) to delete an entire directory on uninstall.

I understand the RemoveFile and RemoveFo

6条回答
  •  失恋的感觉
    2020-11-22 06:51

    Here's a set of properties i made that feel more intuitive to use than the built in stuff. The conditions are based off of the truth table supplied above by ahmd0.

    
     
     
     "" AND REINSTALL="" AND PREVIOUSVERSIONSINSTALLED<>"" AND REMOVE=""]]>
     ""]]>
     "" ]]>
    

    Here's some sample usage:

      NOT _UNINSTALL
      _INSTALL OR _UPGRADE
      _UNINSTALL OR _UPGRADE
      NOT _UNINSTALL
      NOT _UNINSTALL
    

    Issues:

    • UPGRADINGPRODUCTCODE is set during the RemoveExistingProducts action, so any custom actions that you run prior will not know it's an upgrade https://docs.microsoft.com/en-us/windows/desktop/Msi/upgradingproductcode

提交回复
热议问题