Throw a warning in WiX

I am facing a tricky situation where I have two installation packages. One of them depends on the installation of the other. And the deletion must be done in the correct order.

I'm having a lot of trouble getting the conditions to work to prevent it from being removed if it is still installed. I keep creating conditions that prevent deletion no matter what - which is very messy to clean up ...

So, all I want is to raise a warning message when a condition is met. Something like "Warning: you need to remove X before uninstalling this package" with "Exit" and "Ignore" buttons. Is there a way to make a conditional alert in WiX 3?

+2


source to share


1 answer


Seems like one (product A) is a prerequisite for the other (B)?

If so, perhaps the best way would be to prevent B from being installed if A is missing ("ignore" option). For this:

  • decide how you can check if A exists (i.e. the specific registry entry created by this installer: as it is created, you can add it as one of the components).
  • add <Property> with an appropriate search (e.g. RegistrySearch)
  • add <Condition> to <Product>

An example can be found here: http://www.mail-archive.com/ wix-users@lists.sourceforge.net /msg31789.html



Alternatively, you can create a bootloader for B that sets A as a prerequisite (thus making it easier for end users).

If the "ignore" option is really a must, I would create a new dialog with the text + buttons and add it to the customization sequence. But I would not recommend this option, it does not support an unattended installation script.

There is also an alternative - a new feature in Windows Installer 4.5, multi-package installation. However, I have never used this. It also forces users of your software to have Windows Installer 4.5 or newer (always on Windows with Vista SP2 only).

+1


source







All Articles