【发布时间】:2014-12-07 19:15:01
【问题描述】:
有谁知道:
如何强制 wix 安装程序在安装新版本之前卸载任何以前安装的副本,无论是次要版本还是主要版本。
如果 1) 在运行新的次要/主要设置时无法完成,我是否至少可以显示一条消息,指出检测到以前的版本,应首先将其卸载并取消设置?
谢谢。
更新:
我已将以下内容添加到我的 settings.wxi
<Upgrade Id="$(var.UpgradeCode)">
<!-- Populate NEWERPRODUCTFOUND if there is an installed
package with the same upgrade code
and version is > the version being installed -->
<UpgradeVersion
Minimum="$(var.CurrentVersion)"
IncludeMinimum="no"
OnlyDetect="yes"
Language="1033"
Property="NEWERPRODUCTFOUND" />
<!-- Populate UPGRADEFOUND if there is an installed
package with the same upgrade code
and the version is between the earliest version defined
and the version being installed -->
<UpgradeVersion
Minimum="$(var.FirstVersion)"
IncludeMinimum="yes"
Maximum="$(var.CurrentVersion)"
IncludeMaximum="no"
Language="1033"
Property="PREVIOUSVERSIONSINSTALLED" />
</Upgrade>
我在 MyProduct.wxs 中定义了以下内容
<?define CurrentVersion="5.0.0.18"?>
<?define FirstVersion="1.0.0.0"?>
<?define UpgradeCode="c1b1bfa0-9937-49eb-812c-5bac06eff858"?>
最后,我已将此添加到我的<InstallExecuteSequence>
<RemoveExistingProducts Before="InstallInitialize" />
但是当我将我的版本增加到 5.0.0.19 时它仍然没有删除旧版本。
也许我看错了,但在我的“添加/删除程序”窗口中,我看到我的设置列为 5.0.0.18,我看到第二个条目为 5.0.0.19
是否应该在每次更改版本时都更改升级代码?我以为我已经读过这不应该被改变。
有什么想法吗?
谢谢。
【问题讨论】:
-
如果您知道所有可能的 UpgradeCodes 和 ProductVersions,您就不能制作自己的 Upgrade 元素来定位和升级它们吗? WiX MajorUpgrade 可能已经足够了,但如果还不够,您可以在升级元素中列出所有内容。
-
@PhilDW 感谢您的反馈。我会进一步调查。我以前从未进行过升级,我即将完成实际设置,所以我正处于收集信息阶段。
标签: wix windows-installer wix3.7