Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wix: How to limit major upgrades to major version numbers?

Tags:

upgrade

limit

wix

I need the following behaviour from my wix-based installers:

  • Every setup in the major version 1.x.x line should majorupdate any previous version of the 1.x.x line.
  • Every setup in the major version 2.x.x line should majorupdate any previous version of the 2.x.x line but leave the 1.x.x line alone.

I though I could get this to work with the following code, but the setup removed the previous 1.x.x version. Am I mssing something? Is this even possible?

    <Upgrade Id="myguid">
        <UpgradeVersion OnlyDetect="yes" Minimum="2.0.0.1" Property="NEWERVERSIONDETECTED" IncludeMinimum="no" />
        <UpgradeVersion OnlyDetect="no" Maximum="2.0.0.1" Property="OLDERVERSIONBEINGUPGRADED" IncludeMaximum="no" />
    </Upgrade>
    <InstallExecuteSequence>
        <RemoveExistingProducts After="InstallInitialize" />
    </InstallExecuteSequence>
like image 489
Chris M. Avatar asked Sep 07 '11 13:09

Chris M.


1 Answers

You need to use a NEW GUID for 2.x if you don't want it to be "aware" of 1.x (i.e. ignore it, don't care, etc)

I use the following code, only changing var.Property_UpgradeCode when I want a new version to ignore previously installed versions (e.g. exist side-by-side in different folders)

<Product Id="*"
         UpgradeCode="$(var.Property_UpgradeCode)"
         Name="!(loc.ApplicationName)"
         Language="!(loc.Property_ProductLanguage)"
         Version="$(var.version)"
         Manufacturer="!(loc.ManufacturerName)" >

<MajorUpgrade AllowSameVersionUpgrades="yes"
          DowngradeErrorMessage="!(loc.LaunchCondition_LaterVersion)"
          MigrateFeatures="no"
          Schedule="afterInstallInitialize" />
like image 63
saschabeaumont Avatar answered Oct 07 '22 00:10

saschabeaumont