开发者

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

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" P开发者_StackOverflow社区roperty="OLDERVERSIONBEINGUPGRADED" IncludeMaximum="no" />
    </Upgrade>
    <InstallExecuteSequence>
        <RemoveExistingProducts After="InstallInitialize" />
    </InstallExecuteSequence>


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" />


Put @Minimum and @Maximum attributes on a single UpgradeVersion element to specify a range. Author multiple UpgradeVersion elements to specify multiple version ranges.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜