gpt4 book ai didi

wix - 在 wix 中卸载旧版本的 4 位数字,如 1.1.0.1

转载 作者:行者123 更新时间:2023-12-04 02:22:01 26 4
gpt4 key购买 nike

在安装比当前安装版本更高的版本时,需要卸载之前的版本并安装更新的版本。并且安装比当前版本低的版本需要限制安装。 它可用于 3 位数字(1.0.0、2.0.0 等)。但我要求 4 位数版本(1.1.0.1、1.1.0.2 等)。请任何人回答我的问题..

最佳答案

这是 Windows Installer 的设计限制。参见:

ProductVersion property

Remarks

At least one of the three fields of ProductVersion must change for an upgrade using the Upgrade table. Any update that changes only the package code, but leaves ProductVersion and ProductCode unchanged is called a small update. The three versions fields are provided primarily for convenience. For example, if you want to change ProductVersion, but do not want to change either the major or minor versions, you can change the build version.

Note that Windows Installer uses only the first three fields of the product version. If you include a fourth field in your product version, the installer ignores the fourth field.

WiX MajorUpgrade Element有一个名为 AllowSameVersionUpgrades 的属性:

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

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

Note that because MSI ignores the fourth product version field, setting this attribute to yes also allows downgrades when the first three product version fields are identical. For example, product version 1.0.0.1 will "upgrade" 1.0.0.2998 because they're seen as the same version (1.0.0). That could reintroduce serious bugs so the safest choice is to change the first three version fields and omit this 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 version number to upgrade each other.

现在有一种方法可以两全其美。它涉及编写自定义操作,安排在 FindRelatedProducts action 之后, 调用 MsiEnumRelatedProducts function查询 MSI 并识别仅第四个字段不同且低于新产品版本的已安装产品。然后将其添加到升级行中指定的 ActionProperty 并让 RemoveExistingProducts Action做剩下的事。

关于wix - 在 wix 中卸载旧版本的 4 位数字,如 1.1.0.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27936195/

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