views:

163

answers:

3

I have created a msi install package for my project from the VS2008 deployment project. but I am having problems when it comes to upgrading installs, The previously installed version does not get overwritten. How do I ensure that previously installed versions get overwritten?

A: 

Windows Installer has built in checks on your files to make sure that the version is higher than the previous version of that file. If it is not, Windows Installer will not overwrite it. For more extensive info on how Windows Installer handles versioning check out this MSDN article:

http://msdn.microsoft.com/en-us/library/aa368599%28VS.85%29.aspx

Steve Danner
+2  A: 
  1. In Visual Studio select your Setup project within the Solution Explorer
  2. Open the Properties Window
    • don't right click and select properties.
    • select View - Properties Window
  3. set RemovePreviousVersions to true
  4. increment the version to a higher number
  5. select yes in the upcoming message box

If you built and deploy this new setup, a setup with an older version number will be deleted.

Important: the setup version number is completely independent from your application or assembly version number!

Oliver
A: 

We need to set REINSTALLMODE property of our msi file to amus.

Following is the link to know more about the meaning of 'amus' http://msdn.microsoft.com/en-us/library/aa371182%28VS.85%29.aspx

There are two ways to do that.

  1. By using msiexec.exe which comes with .NET SDK (if you have VS 2005 or VS 2008 it will come with it, just browse to command prompt of visual studio and you will find it there)

once you find msiexec.exe just type following command to set REINSTALLMODE property to amus for your installer.

msiexec.exe /i foo.msi REINSTALLMODE=amus

Jinal Desai - LIVE