1

I'm requested to implement custom action with parameters on uninstall from command line:

msiexec /x MyInstaller.msi PARAM_FILE_PATH="..." /qn

Looks like common approach looks like is this:

<Custom Action="ActionName" Before="RemoveFiles">(REMOVE~="ALL") AND (NOT UPGRADINGPRODUCTCODE)</Custom>
<Custom Action="ActionName" Before="InstallFinalize">(REMOVE~="ALL") AND (NOT UPGRADINGPRODUCTCODE)</Custom>

But in both cases ActionName is not executed (checked via debug output).


Tried few things.

Not executed on install and uninstall:

<Custom Action="ActionName" Before="RemoveFiles"></Custom>

Runs only on install (opposite of what I need):

<Custom Action="ActionName" Before="InstallFinalize"></Custom>
InfernumDeus
  • 1,185
  • 1
  • 11
  • 33
  • [Custom actions are hard outright](https://stackoverflow.com/a/46179779/129130) and a leading cause of deployment failure. Uninstall custom actions are often the worst in terms of malfunction. Can we ask what the custom action needs to do? There might be alternatives. [An answer on conditions here](https://stackoverflow.com/questions/50912568/wix-custom-uninstallation-action-how-to-run-before-msi-removing-files). [One more](https://stackoverflow.com/questions/47941301/wix-tools-update-uses-old-custom-actions/). – Stein Åsmul Oct 31 '20 at 10:13
  • [You can test MSI conditions using VBScript CAs to implement "message boxes"](https://stackoverflow.com/a/52377800/129130). This approach is highly recommended to try. Remember to test major upgrade scenarios and different installation modes (install, uninstall, major upgrade uninstall, patching, repair, self-repair, etc...). – Stein Åsmul Oct 31 '20 at 10:20

0 Answers0