1
votes

I have an MSI installer in which i have below configuration:

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." AllowSameVersionUpgrades="yes"/>

Suppose i already installed 1.0.0.0 version.

Next time, if i install 1.0.0.1 version. It upgrades the same application as expected.

Next time, if I try to install 1.0.0.0 version. Installer does not allow me to select feature(as expected) but allow to install without selecting any feature but the top checkbox. I want here that installer should not allow to process in any case if version is down.

Another problem, If version 1.0.0.0 is installed and i open the same installer, it shows the modify, repair and remove screen as expected. But if i build the VS project and install the same version that already installed. It allow me to install and in program and feature, it shows two application with same version. I don't want this. Is there any flag or congratulation i need to use to do this?

1

1 Answers

1
votes

ProductVersion: Only the first three digits of ProductVersion have effect for major upgrades. Make sure you bump up at least the third digit and the major upgrade should work and remove the prior version(s). I would strongly recommend that you don't try to hack around with this, but simply accept the 3 digit version rule limitation. As to the question why, this is a limitation of Windows Installer. One of the worse ones.

Automagic ProductCode: You must have set the product code to be automatically generated. This means that every rebuild will make a new product code, and essentially set up a major upgrade to happen. This major upgrade fails because of your erroneous 4-digit version number being bumped up in the 4th digit only and two side-by-side installed versions of your application results since the major upgrade detection and running fails.