Can't prevent downgrade

696 views Asked by At

I have tried to make an installation with the following requirements.
1. Should handle major upgrade and prevent downgrades.
2. Should handle minor upgrades/updates and prevent downgrade.
3. Should be patchable and prevent downgrade.
And of course all in the same package

So far I have run in to the one obstacle after another.
FindrelatedProducts does not run in maintenance mode so I can't really check for other products installed with the upgradeversion tag.
Can't have ProductCode="*" as pyro does not like that creating a patch.
Also I have noticed that preventing a downgrade, built according to https://www.firegiant.com/wix/tutorial/upgrades-and-modularization/, does not really work running the installation from a command line with the switches REINSTALL=ALL and REINSTALLMODE=vomus. Seems like the switches disregard the upgrade version settings.

I'm pretty sure that I missed something, but I can't see it. Does anybody have any tips on how to accomplish this?

My upgrade element looks like

<Upgrade Id="put-guid-here"> 
  <UpgradeVersion OnlyDetect="yes" Property="SELFFOUND" Minimum="6.1.15119" 
                  IncludeMinimum ="yes" Maximum="6.1.15124" IncludeMaximum="yes" />
  <UpgradeVersion OnlyDetect="yes" Property="NEWERFOUND" Minimum="6.1.15124" 
                  IncludeMinimum="no" />
</Upgrade>
1

There are 1 answers

0
PhilDW On

Major upgrades require a change of ProductCode (and some other things) to install a new version and, and you can prevent downgrades because it's built into Windows Installer.

Minor upgrade against an installed product require an MSI with the same ProductCode, because you are targeting the already installed product for maintenance (as opposed to installing a completely new one) and they require REINSTALL and REINSTALLMODE to be set on the command line. None of the major upgrade logic is used in this type of update, it's mainly to update files and is an alternative to a patch.

What that means is that nobody can do a a downgrade by running a minor upgrade unless you specifically build an MSI file with the same ProductCode (as one you've already shipped) and with a lower ProductVersion, and then tell people to install it with REINSTALL and REINSTALLMODE. Are you actually going to do that? It doesn't seem like it from your question. Also, note that if the only MSI files you ever ship have all got different ProductCodes then you'll never have the problem.

So all you need do is major upgrades, and perhaps you'll build occasional patches. So again, you don't need to worry about minor upgrades because there will never be any MSI files out there that can be used for that.