I have a VS2008 setup project, which creates a setup.msi which installs a WinForms application (C#).
Every time I update the version number, the users first have to uninstall the previous version before they can install the new one. Otherwise we get the dreaded "Another version of this product is already installed" message.
This is what I'm doing already when I build a new version of the installer:
And yet it still refuses to uninstall the previous version. So, what have I missed? Or what am I doing wrong?
Thanks!
Semi-answering my own question, just for the benefit of anyone who's interested:
Firstly, I found an incredibly useful article on how MSI updates work.
Secondly, I found InstEd, a rather nice freeware MSI editor, which showed me that there was nothing obviously wrong with my MSI file. (Yes, I could use Orca instead, if I didn't mind downloading the whole Windows SDK to get it.)
Thirdly, and annoyingly, the original problem seems to have fixed itself and I can't reproduce it any more. If it comes back, and if I fix it again, I'll add a comment here!
Anyway, all this brought up a new - arguably worse - problem: the MSI now claimed to update the application but didn't actually install anything! The solution to that is as follows:
To have it install over the previous version:
Keep in mind, even if you rebuild the solution it doesn't rebuild the setup project. You need to rebuild the setup project as a separate step.
Second, you don't need to Increment AssemblyVersion every time. Set it to something like 2.1.* and it will do it automatically.
I am not 100% familiar with VS 2008 setup projects (I use Advanced Installer myself- HIGHLY recommend it BTW; they even have a freeware version!), but I have run into this before and it's not documented very clearly.
There are 4 parts to the version number- as you are well aware I'm sure: Major.Minor.Build.Revision. The REVISION is NOT checked by windows installer. If all you're doing is incrementing the revision, it won't work. You have to increment at least the build of the ProductVersion value.
Hope that helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With