wixcustom-actionwix4

Wix v4: Run custom action only on install


In wix 3 you could specify a condition inside the custom element.

In wix 4 the same element does not seem to accept inner text anymore. If you try to set a condition the compiler throws a The Custom element contains illegal inner text: 'NOT Installed AND NOT UPGRADINGPRODUCTCODE' error. How would one go ahead and only run the custom action during the installation now?


Solution

  • Condition is an attribute on the Custom element: https://wixtoolset.org/docs/reference/schema/wxs/custom/