msi 安装程序卸载
我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你是对的——这是可能的。
基本上,您需要更改两个属性。首先,您需要设置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.