Cat Zimmermann
Cat Zimmermann

Reputation: 1420

Prevent Windows installer (MSI) downgrade with WiX and UpgradeCode

I released a Windows installer (V1) built with WiX 3.5. V1 has an UpgradeCode, but no Upgrade or MajorUpgrade elements. V2 is not released yet.

I can add the MajorUpgrade element to both a V2 and V3 installer, and the downgrade from V3 to V2 can be detected and prevented. I understand during the installation of V2 I can also detect V1.

The problem:
Currently I can install V1 over V2 in the same directory, and both versions appear in Add / Remove Programs. The V1 files overwrite the V2 files. Uninstalling V1 does not remove V2 from Add / Remove Programs, but does delete the V2 files, as they have the same pathnames as V1. The user is left with an unusable V2 installation.

Is it possible to prevent V1 from installing after I've installed V2?
OR
Is it possible for V1 to correctly uninstall V2?

Upvotes: 0

Views: 1136

Answers (1)

PhilDW
PhilDW

Reputation: 20780

Prevention of a downgrade requires the upgrade detection logic to work, and it looks like it isn't because you get two ARP entries. V1 and V2 need the same UpgradeCode, V2 must have a version that is greater than V1 in the first three fields, and the InstallScope must match. If V2 was installer per user (or per machine) then V1 will also install and not upgrade if it's not the same scope.

Upvotes: 1

Related Questions