Reputation: 706
While working with my deployment project for my outlook add-in, I've had to rebuild the msi a more than a couple of times. I was wondering what the best practices are for upgrading my installed msi as well as reverting to older versions.
I've written a lot of different batch files to handle the job, but none of them seem like the best way to complete this task. Currently I have two batch files, one to upgrade and the other to revert.
To upgrade all I do is either change the product code or change the version number and the product code. Then I run the simple command myapplication.msi /quiet
. This works because of the change of product code and version number, though the version number can remain the same and switch the setup to not detect newer versions. Otherwise I get the "Another version of this product is already installed." error
To revert, I have the following command: C:\Windows\System32\msiexec.exe /quiet /x myapplication.msi
followed by the one above with the previous version name (usually prevmyapplication.msi
). This is working fine, but it feels that there's probably a better way.
Thanks for any help in direction.
Upvotes: 0
Views: 153
Reputation: 55601
The by the book answer is that you are doing it the correct way. Microsoft has asserted that allowing "downgrades" is not the expected user behavior and that one must do an uninstall / reinstall to do so.
I've used a pattern where we intentionally allow downgrades. The reason is so operations has an easier go at it. The SCCM advertisement that takes you from 1.0 to 2.0 can also take you from 3.0 to 2.0. There is a downside though that if operations messes up and has multiple, conflicting advertisements you can get a tug of war.
Upvotes: 1