views:

38

answers:

1

In reference to the post below, where it says I should increase the version number for older versions to be replaced by newer ones.

http://stackoverflow.com/questions/40603/msi-installer-fails-without-removing-a-previous-install

What I find is, just changing the version number didn't do the job. I had to change the product code also, which I got an option to change through a Message Box just after changing the Version Number.

Is this how it's supposed to be?

A: 

I think Visual Studio setup project uses the version number to generate the Product Code which is why you must update both. The product code is a unique GUID that identifies the installed application. It is good practice to update both each time you release an installer. Otherwise the client will get a message that says something like "Another version of this application is already installed, please uninstall that version first..." etc. and the MSI will not install the new version.

So to remove a previous version before installing a new version you must set RemovePreviousVersions property to True and update the version number and product code.

You can automate the version number and product code part by executing a script in the PreBuildEvent of the setup project. You can find interesting article and sample script on CodeProject http://www.codeproject.com/KB/install/NewSetupVersion.aspx

Peter Kelly