views:

104

answers:

3

Dear all,

When I install my application using the msi file for the second time, I found 2 different behaviors:

1) Sometimes it displays a warning window informing me that there is a previous version installed in your PC. If you want to remove it, please go to control panel.

2) It displays a wizard which asks me if I want to repair or remove the application.

Actually, I don't want the first behavior. I want him to ask me either to repair the previous version or to remove it. How to do that?!?

+1  A: 

i found the solution.. i should set DetectNewerInstalledVersion property to false so that it will do the second behavior.

please correct me if i'm wronge

Eng.Basma
You may also want to take a look at the RemovePreviousVersion property to ensure that does what you want.
Martin Brown
+1  A: 

If you want for the setup to automatically uninstall the old version of your app, you could do the following:

  1. Increment the version number of your app in the setup
  2. After you do that, VS will pop up a dialog asking if you want a different Product Id. (answer yes/ok)
  3. Make sure tha t RemovePreviousVersion is true.

Next time you install (assuming and older version is present), your setup will automatically uninstall the older version and install the new.

The magic is caused by one last guid -- the GroupCode. The guid must ALWAYS be the same across all versions of your product. So the logic is that if the version number has changed, and the product code has changed, but the group code is the same, an automatic uninstall will occur.

JMarsch
A: 

Had the same problem and setting DetectNewerInstalledVersion to false solved it. I belive this problem was introduced to me when changing from XP to Win7.

Muleskinner