如何实施WiX安装程序升级? [英] How to implement WiX installer upgrade?
问题描述
在工作中,我们使用 WiX 构建安装包.我们希望产品X的安装将导致在该计算机上卸载该产品的先前版本.
At work we use WiX for building installation packages. We want that installation of product X would result in uninstall of the previous version of that product on that machine.
我已经在Internet上的多个地方阅读过有关重大升级的信息,但是无法正常工作. 有人可以指定要向WiX添加卸载以前版本功能所需的确切步骤吗?
I've read on several places on the Internet about a major upgrade but couldn't get it to work. Can anyone please specify the exact steps that I need to take to add uninstall previous version feature to WiX?
推荐答案
在最新版本(从3.5.1315.0 Beta开始)中,您可以使用
In the newest versions (from the 3.5.1315.0 beta), you can use the MajorUpgrade element instead of using your own.
例如,我们使用此代码进行自动升级.它可以防止降级,提供本地化的错误消息,还可以防止升级已经存在的相同版本(即仅升级较低的版本):
For example, we use this code to do automatic upgrades. It prevents downgrades, giving a localised error message, and also prevents upgrading an already existing identical version (i.e. only lower versions are upgraded):
<MajorUpgrade
AllowDowngrades="no" DowngradeErrorMessage="!(loc.NewerVersionInstalled)"
AllowSameVersionUpgrades="no"
/>
这篇关于如何实施WiX安装程序升级?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!