tags:

views:

148

answers:

1

I am running into a complex situation where I have two install packages. One depends on the install of the other. And uninstall must be done in the correct order as well.

I am having a lot of trouble getting the conditions to work to prevent one from being uninstalled if the other is still installed. I keep making conditions that prevent uninstall no matter what - which is very messy to clean up...

So all I want now is to raise a warning message when a condition is met. Something like "Warning: You should uninstall X before you uninstall this package" with Quit and Ignore buttons. Is there any way to make a conditional warning in WiX 3?

+1  A: 

It looks as if one (product A) is a prerequisite for the other (B)?

If so, possibly the best way would be to prevent installation of B if A is missing (no "ignore" option). To do that:

  • decide how can you verify that A exists (i.e. specific entry in registry created by this installer: as you build it you may add it as one of components)
  • add <Property> with appropriate search to it (i.e. RegistrySearch)
  • add <Condition> to <Product>

An example could be found i.e. here: http://www.mail-archive.com/[email protected]/msg31789.html

Additionally, you could create a bootstrapper for B that installs A as 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 setup sequence. But I wouldn't recommend this option, it doesn't support scenario of silent installation.

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

Przemyslaw Dzierzak