gpt4 book ai didi

wix - 我们可以在更改产品代码的同时将 1.0.0.0 升级到 1.0.0.1 吗?

转载 作者:行者123 更新时间:2023-12-01 07:14:30 28 4
gpt4 key购买 nike

我被要求将版本 1.0.0.0 升级到 1.0.0.1。默认情况下,当我使用虚拟安装程序进行测试时,如果我们更改产品代码,1.0.0.0 和 1.0.0.1 将并排安装。

但是如果我们做ver 1.0.1.0(同时更改产品代码),它会进行升级。这是我的升级部分:

   <Upgrade Id="{354E9DAE-EB70-4BCC-BD93-AC20ACE3F370}">
<UpgradeVersion
Maximum="$(var.ver)"
Property="DOMAJORUPGRADE"
MigrateFeatures="yes"
IncludeMinimum="yes"/>
</Upgrade>

问题:有什么方法可以将 1.0.0.0 升级到 1.0.0.1?

实际上,我得到了这样的场景:
  • 在 1.0.0.0 之上安装 1.0.0.1 时,则需要升级 1.0.0.0。
  • 在 1.0.0.1 之上安装 1.0.0.0 时,1.0.0.0 需要失败。
  • 在具有不同产品代码的 1.0.0.1 之上安装 1.0.0.1 时(仅在开发版本中可能),需要卸载现有的 1.0.0.1。
  • 最佳答案

    查看帮助主题 MajorUpgrade Element :
    以下是关于 AllowSameVersionUpgrades 属性的说明:

    When set to no (the default), installing a product with the sameversion and upgrade code (but different product code) is allowed andtreated by MSI as two products. When set to yes, WiX sets themsidbUpgradeAttributesVersionMaxInclusive attribute, which tells MSIto treat a product with the same version as a major upgrade.

    This is useful when two product versions differ only in the fourthversion field. MSI specifically ignores that field when comparingproduct versions, so two products that differ only in the fourthversion field are the same product and need this attribute set to yesto be detected.

    Note that because MSI ignores the fourth product version field,setting this attribute to yes also allows downgrades when the firstthree product version fields are identical. For example, productversion 1.0.0.1 will "upgrade" 1.0.0.2998 because they're seen as thesame version (1.0.0). That could reintroduce serious bugs so thesafest choice is to change the first three version fields and omitthis attribute to get the default of no.

    This attribute cannot be "yes" when AllowDowngrades is also "yes" --AllowDowngrades already allows two products with the same versionnumber to upgrade each other.


    蒂姆的答案是 95% 正确。我真的不建议只更改第 4 个版本。也就是说,有一种方法可以减轻上面提到的“意外降级”错误。编写未检测到相同版本的 MajorUpgrade 规则。然后编写一个自定义操作,对第四个字段中更大的产品进行额外检查并共享您的升级代码。将此检测到的 ProductCode 设置或附加到 ActionProperty。在 FindRelatedProducts 和 RemoveExistingProducts 之间安排此自定义操作,您将获得 Windows Installer 从未设计过的所需行为。

    关于wix - 我们可以在更改产品代码的同时将 1.0.0.0 升级到 1.0.0.1 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16642518/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com