0

We want to rollout a new major release (V2.0) of a .net application on windows via WIX.

This rollout will be a per-machine installation. Updates will be major updates (e.g. V2.1,...). This mechanism works as expected. When the product is updated it is replaced by the new version in the registry. However it doesn't replace previous version (below V2.0).

Previous versions of this product (V1.0,V1.1,V1.5) were also installed with WIX, but in a different way. These were per-user installations. The product installers had a defined ProductCode. Major upgrade installers had set, so the product code changed for each upgrade installer. Every new upgrade resulted in a new registry entry. So after upgrading we had a version 1.0, 1.1, 1.2 in the registry (and the "Remove programs"-dialog)

With version 2.0 however I want to clean up everything. All Version 1 installation should be removed. The only thing that is common for all installers is the upgrade code. Unfortunately, versions v1.x stay untouched when running my V2.x installer.

Is there a way to achieve this with Wix natively or a custom action?

2 Answers 2

0

Per: Major Upgrades

Note If an application is installed in the per-user installation context, any major upgrade to the application must also be performed using the per-user context. If an application is installed in the per-machine installation context, any major upgrade to the application must also be performed using the per-machine context. The Windows Installer will not install major upgrades across installation context.

There are ways to address this with bootstrapper cleanup utilities but even that may not work because the per-user installation might have been done using a different user account and would be out of scope.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! In 90% of all cases the user running the new installer is the same as of the old installer. So maybe I should give it a try. I also found a way to obtain the ProductCodes of the UpgradeInstaller (via wirunsql.vbs). Could you please guide me on the right path regarding the "bootstraper cleanup utilities" or any other solution?
The simplest solution is to author an empty MSI that is set for Per-User and shares the legacy UpgradeCode. Then use a bootstrapper to run this MSI before your MSI. The Per-User install will run and remove the previous product. But since it didn't actually install any components it'll return 0 but not actually be installed. Then your MSI runs and installs and you are where you want to be.
0

It should just work if your UpgradeCode is the same assuming:

  1. You have incremented the ProductVersion in the first 3 digits.
  2. Your new product has actions FindRelatedProduct, RemoveExistingProducts. In other words the WiX upgrade stuff or a MajorUpgrade element.
  3. Both installs are in the same context (per user over per user or per machine over per machine).

I can't tell from the earlier posts if these are happening or not.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.