Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Setup project does not uninstall previous version

$
0
0
Hello,

I am using Visual Studio to build an installer for my application. I am using a "windows installer setup project" (as opposed to clickonce).

My purpose is to create an installer (msi or exe) which automatically detects and uninstalls the previously installed version of the application, then installs the new version. I can't find a way to do it. Depending on how I set the "product code", the resulting .msi file either does not recognize that a previous version is already installed, or it does recognize it but asks to uninstall the previous version manually. Neither behavior is acceptable for my product manager.

This is what I am doing in Visual Studio's properties panel related to the setup project:

1) set "DetectNewerInstalledVersion" to true. (I also tried false, to no avail)

2) set "RemovePreviousVersions" to true.

Then, each time I build a new version:

1) I increment the "Version" property. For example, I increase it from 1.0.15 to 1.0.16. ( I also tried from 2.0 to 3.0 and the result is the same)

2) then a Visual studio dialog box appears which strongly suggests me to change the "product code". Depending on whether I choose "yes" or "no", I get different problems:

2.1) If I accept to change the product code, then, when I double-click on the resulting msi or exe installer, the installer does not detect the previously installed version. It tries to overwrite the files in the previous version, it fails to overwrite the exe file, and the resulting application crashes at startup.

2.2) If, on the other hand, I do _not_ change the product code, then, when I double-click on the resulting msi or exe installer, the installer _does_ detect the previous version, but a dialog box asks me to uninstall it from the control panel first, then relaunch the installer. I need the uninstall to be automatic, without having to open the control panel.

__

Ironically I have discovered that, if I install the application by right_clicking on the setup project inside visual studio, and then choose "install", the installer behaves correctly: it automatically detects and uninstalls the previous version, then installs the new version. Why is that not happening when I double-click on the generated .msi or .exe files?

Thanks a lot for any help.

Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>