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 installe
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.
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
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
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's answer is correct, but I wanted to add pictures and some more details)
Select the setup project in your solution, then open the Properties pane (the tab next to Toolbox):
DetectNewerInstalledVersion
is true (it is be default)InstallAllUsers
to trueRemovePreviousVersions
to trueVersion
number and hit EnterProductCode
, click yesAdditionally, you need to update the version numbers for each project in your solution, because the installer will only replace DLLs if their version number has been incremented:
AssemblyVersion
and AssemblyFileVersion
numbersOr a better way:
AssemblyVersion
and AssemblyFileVersion
lines from each project's AssemblyInfo.csRight-click on the setup project and select Properties (a different Properties dialog):
I'm not sure if all of these steps are necessary, and there may be other ways to set this up, but the above steps work for me.