Reputation: 16785
According to this tutorial, following code should prevent downgrade and reinstalling of the same version of application.
<CustomAction Id='AlreadyUpdated' Error='Foobar 1.0 has already been updated to 1.0.1 or newer.' />
<CustomAction Id='NoDowngrade' Error='A later version of [ProductName] is already installed.' />
<InstallExecuteSequence>
<Custom Action='AlreadyUpdated' After='FindRelatedProducts'>SELFFOUND</Custom>
<Custom Action='NoDowngrade' After='FindRelatedProducts'>NEWERFOUND</Custom>
</InstallExecuteSequence>
How should this functionality work?
Should there be some error message and installation should be stopped?
As I can see these example does not work at all - it is possible to downgrade and to install the same version of application several times using command "msiexec /i SampleUpgrade.msi REINSTALLMODE=vomus".
An there are mo any error messages.
I use WIX 3.8, Windows 7.
Upvotes: 1
Views: 286
Reputation: 20780
There may be some assumptions you have that we're unaware of, but you cannot install the same MSI setup twice. The installed product is defined by it's ProductCode and PackageCode, but more importantly what is it that you are trying to accomplish? If you want multiple copies of the "same" product then (for example) make another with a new ProductCode and PackageCode. If you want to update the existing installed product with new files, then make a major upgrade. If for some reason that means reinstalling the same setup again to replace the existing one then the WiX MajorUpgrade Element using AllowSameSamneVersionUpgrades might be what you want. The REINSTALLMODE command line is a way of updating the existing installed product, not of installing another copy.
In other words without knowing your goal it's not clear how to get you to where you want to go.
Upvotes: 1