Bizmarck
Bizmarck

Reputation: 2688

Prompting for user confirmation before upgrading previous version

Using WiX, we would like to be able to uninstall a previous version if it is already installed. I am able to do this automatically based on the thread here.

But how does one go about prompting the user if they actually want to uninstall the old version first, before running the RemoveExistingProducts action? ie. through a custom menu item that only launches if FindRelatedProducts returns 1, for example?

Upvotes: 2

Views: 1608

Answers (1)

Cosmin
Cosmin

Reputation: 21416

You can try this approach:

  1. In Upgrade table define a rule for older product versions: http://msdn.microsoft.com/en-us/library/aa372379(VS.85).aspx
  2. For this rule set the ActionProperty column to a custom property, for example OLDER_PRODUCTS
  3. Use this property to conditionally show a custom dialog in which the user can select if he wants an upgrade or not.
  4. Use the properties in the custom dialog to condition RemoveExistingProducts standard action.

This way the upgrade rule detects older versions and shows a custom dialog if it does. This custom dialog can then take the user choice and use it to skip the upgrade.

Upvotes: 2

Related Questions