每当开发人员签入更改时,我都会让 CI 构建系统构建一个 MSI。我们在已安装的 MSI 上运行自动化验收测试。
基本上每个 MSI 都是产品的完整安装,因此我们本身没有任何版本控制(ala Windows 安装程序)。
每个 MSI 具有相同的产品 GUID 和升级 GUID,以及相同的版本号。但具有不同的包 GUID(在 wix 中使用“*”)。
我想要实现的是,当安装程序运行时,它将“卸载”任何以前安装的产品版本,并安装新版本..全部来自单个 MSI(我们有一个复杂的安装过程,这是我们无法控制的.. citrix 和 sccm,所以我们想给他们一个简单的安装路径)
我试过了:
<Property Id='PREVIOUSVERSIONSINSTALLED' Secure='yes' />
<Upgrade Id='$UPGRADE_GUID'>
<UpgradeVersion Minimum='1.0.0.0'
Maximum='99.0.0.0'
Property='PREVIOUSVERSIONSINSTALLED'
IncludeMinimum='yes'
IncludeMaximum='no' />
</Upgrade>
并且有:
<InstallExecuteSequence>
<RemoveExistingProducts After='InstallFinalize' />
</InstallExecuteSequence>
并尝试过:
<InstallExecuteSequence>
<RemoveExistingProducts After='InstallInitialize' />
</InstallExecuteSequence>
但是,当我尝试从后续版本安装 msi 时,我得到:
Another version of this product is already installed. Installation of this version cannot continue.
To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel.
这不是我真正想要的..
我知道我可以只更新产品标签中的版本属性,但这变得难以管理。首先,我每天可以生成 20 多个 msi 构建,因为我有许多生成 MSI 的构建管道,并且不确定如何以有意义的方式处理版本编号。
也许 Windows Installer 只是不允许这种类型的“总是覆盖已安装的版本”安装?