Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top