Condition: If you assign that condition to a custom action it appears it will run
in all installation modes except manual uninstall or uninstall
initiated by a major upgrade. So that would be fresh install
, repair
, modify
, self-repair
and minor upgrade
. Note on what happens on major upgrade below.
Note that there are a few special installation modes or rather sub-modes that are rarely properly tested: suspended install
- essentially installations resumed after reboot
(AFTERREBOOT and RESUME properties), and there are rollback
and commit
modes that may run unless disabled - and there could be more. These are "aspects" of the other modes - in other words they can or will be invoked as appropriate depending on circumstances.
Here Be Dragons: You should be aware that the action will still run during the major upgrade process though, just not from the old setup that is being uninstalled. Rather it will run from the new setup that is installing the updated application (next version) - provided you haven't updated the condition in the new setup when it comes along.
Confucius Says: This "run from new version" or "run from old version" issue can be very confusing, and it is made worse by the fact that the sequencing (order) of uninstall versus install can be switched around. In other words the old version might be uninstalled before the new version is installed, or it might be uninstalled after the new version has been installed. This could affect what files are present on disk if you try to access them (among other things). They could be uninstalled already by the time your setup tries to access them. It all depends on how you configure things as a whole.
Custom Actions: Custom actions are difficult. Here is my propaganda against them: Why is it a good idea to limit the use of custom actions in my WiX / MSI setups? This is not to say that they are not needed - they are at times, but you must avoid them at all cost if you can. There is also a little check list for unwanted custom actions in the first section here: How do I avoid common design flaws in my WiX / MSI deployment solution?. Essentially you should never use custom actions for these purposes: to install services
, to install to the GAC
, to run .NET installer classes
, to install prerequisites
, to run batch files
or similar.
Some Links: