开发者

msi Installer Uninstall

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 ti开发者_运维知识库me, 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜