msi 安装程序卸载

发布于 2024-09-07 12:08:59 字数 272 浏览 2 评论 0原文

我有一个 msi 安装程序(VS2008 安装项目)。我希望安装程序首先检测该软件是否已安装在计算机上。如果是,则卸载该软件,然后继续安装。

有许多属性,例如 DetectNewerInstalledVersion、RemovePreviousVersions 和 ProductCode,似乎暗示这是可能的。目前,我每次都必须重新生成 ProductCode,并在已安装的程序列表中获得一个附加条目(控制面板 -> 添加/删除程序)。

有没有办法可以将安装程序配置为自动卸载任何以前的版本?

I have an msi installer (VS2008 set-up project). What I would like to happen, is for the installer to initially detect if the software is already installed on the machine. If it is, then to uninstall that software and then continue the install.

There are a number of properties, such as DetectNewerInstalledVerision, RemovePreviousVersions and ProductCode that seem to imply this is possible. Currently, I have to regenerate the ProductCode each time, and get an additional entry in my installed program list (Control Panel -> Add / Remove Programs).

Is there a way that I can configure the installer to uninstall any previous versions automatically?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤千羽 2024-09-14 12:09:01

你是对的——这是可能的。

基本上,您需要更改两个属性。首先,您需要设置RemovePreviousVersions,以便您想要的事情真正发生。然后,为了识别旧版本,您还需要在每次部署时设置版本号。每次发布版本时,请手动更新此数字(到更高的数字),或通过部署自动更新它。当安装程序运行时,它会检测以前安装的版本是否较低,并自动删除它们。

You are correct - it is possible.

Basically, you need to change two properties. First, you need to set RemovePreviousVersions so that what you want will actually happen. Then, in order for an older version to be recognized, you also need to set the Version number with each deployment. Each time you do a release, manually update this number (to a higher number), or have it update automatically with deploy. When the installer runs, it will detect if any of the previously installed versions are a lower number and remove them automatically.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文