I have created a Visual Studio setup project. Now it has all the necessary stuff to install on to a computer. The problem is every time I increase the version for the project it installs properly but it does not delete the previous entry in the Control Panel - Add/Remove Program. What should I do to make sure previous version is removed by the installer. I have the RemovePreviousVersion Property set to true. Please help.
-
1Are you increasing one of the first three version numbers? Windows Installer ignores the fourth one. Also, do all versions use the same installation type (per user or per machine)?– CosminFeb 25, 2011 at 7:26
-
1Figured it out. To remove previous version you have to keep the same upgrade code.– Soham DasguptaFeb 28, 2011 at 9:26
4 Answers
Perform a log during the installation of the second product. Use: msiexec /i YourPackage.msi /l*v log.txt
Search for FindRelatedProducts action in order to see if the older version is detected properly.
In order your second installation to be an upgrade you should have an UpgradeCode in your property table which would be the same throughout your installers and in Upgrade table there should be an appropriate value matching include lowest/highest version. Some info on upgrade table: https://msdn.microsoft.com/en-us/library/windows/desktop/aa372379(v=vs.85).aspx
The most common issues in VS upgrades tend to be:
- Not following all the rules. This explains them:
https://www.simple-talk.com/dotnet/visual-studio/updates-to-setup-projects/
You must have the same UpgradeCode, different ProductCode and incremented Version, all of which are in the setup project's Property page (NOT the same as "Properties")
- The first install was Everyone (or Just me) and the upgrade is not. One will not upgrade the other.
You must uninstall your product using your earlier install package. You can do it manually in the control panel, or by rightclicking the install project and selecting uninstall.