0

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?

gthvmt
  • 3
  • 1
  • 1

3 Answers3

1

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

Bob Arnson
  • 21,377
  • 2
  • 40
  • 47
0

I ended up checking the REMOVE parameter inside the custom action itself to check whether it got called during a uninstall and then run the logic accordingly.

var isUninstall = session["REMOVE"] == "ALL";

The only problem with that solution is that this way I cant make sure that the custom action logic does not run on patches as well.

gthvmt
  • 3
  • 1
  • 1
0

Pro Tip: WiX's v3 to v4 code converter is really good. Author what you know in v3 and then convert it v4 and diff the before and after to quickly learn new changes in v4.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100