如何实现 WiX 安装程序升级? [英] How to implement WiX installer upgrade?

查看:24
本文介绍了如何实现 WiX 安装程序升级?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在工作中,我们使用 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 开始),您可以使用 MajorUpgrade 元素 而不是使用您自己的元素.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆