How to pass CustomActionData to a CustomAction using WiX?

Deferred custom actions can not directly access installer properties (reference). In fact, only CustomActionData property session.CustomActionData and other methods and properties listed here are available on the session object. Therefore, for a deferred custom action to retrieve a property such as the INSTALLLOCATION, you have to use a type 51 custom action — i.e. a … Read more

Removing files when uninstalling WiX

Use RemoveFile element with On=”uninstall“. Here’s an example: <Directory Id=”CommonAppDataFolder” Name=”CommonAppDataFolder”> <Directory Id=”MyAppFolder” Name=”My”> <Component Id=”MyAppFolder” Guid=”*”> <CreateFolder /> <RemoveFile Id=”PurgeAppFolder” Name=”*.*” On=”uninstall” /> </Component> </Directory> </Directory> Update It didn’t work 100%. It removed the files, however none of the additional directories – the ones created after the installation – were removed. Any thoughts on … Read more

Why is it a good idea to limit the use of custom actions in my WiX / MSI setups?

Core: Essentially custom actions are complex to get right because of complexity arising from: Sequencing-, Conditioning- (when it runs – in what installation mode: install, repair, modify, uninstall, etc…) and Impersonation-issues (security context it runs in). It results in overall poor debugability – very hard hard work to test in all permutations. Application Launch: Solution? … Read more