Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

upgrade with lower file version

Updated: 21 May 2010 | 4 comments
Alan Sinclair 2's picture
0 0 Votes
Login to vote

(this is so basic it's embarrassing to ask )



An engineer here wants to make an upgrade MSI that includes a file with a lower version than the installed package. Please confirm (or correct) me in thinking this is not possible.



I.e.

MSIv1 has MYFILE v 5

MSIv2 has MYFILE v 4



MSIv1 installs fine. Now upgrade by installing MSIv2. The log says "Disallowing installation of component: {7F027A27-59F9-11D3-85C0-0050040127F4} since the same component with higher versioned keyfile exists".



We have RemoveExistingProducts (REP) between InstallValidate and InstallInitialize, so presumably MYFILE is removed from disk by REP but not replaced later.



Unfortunately I've forgotten why we moved RemoveExistingProducts before InstallInitialize (it was to solve some problem five years ago -- one snag to the Wise tool is that commenting isn't possible, which might make us move to WiX) though I've seen that location recommended often.



Experimentally moving REP after InstallFinalize seems to leave the files installed properly. What snags might come up with REP at the end? We have a lot of custom actions that will probably have to be re-conditioned -- e.g. uninstall runs CAs to remove drivers, which obviously shouldn't happen if the uninstall is the last part of an upgrade.



Thanks for any help clearing my head.

discussion Filed Under:

Comments

Bill MacEachern's picture
01
Oct
2008
0 Votes 0
Login to vote

Try:



msiexec.exe YourSetup.msi REINSTALL=ALL REINSTALLMODE=vamus



I have a project with a WiseScript wrapper. They wanted to be able to downgrade as well as upgrade, so my wrapper checks for the previous version and, if found, kicks off the new setup with the above command-line. All existing files get overwritten regardless of file version. (The wrapper also installs some prereqs, but that's not important here.)



Alan Sinclair 2's picture
01
Oct
2008
0 Votes 0
Login to vote

thanks Bill



That's a useful alternative! It works nicely (with msiexec /i mysetup ... is that right?) and all files are installed.



It's nice that the lower-version file in the newer MSI doesn't overwrite the higher-version file that's already on disk.



There is a snag in that custom actions conditioned on "$component-action-state = 3" are skipped (condition is false) so upgraded devices wouldn't be installed properly, but maybe the condition could be changed to allow for this. Maybe ($component-action-state = 3" OR "$component-install-state = 3) would do it, or some elaboration on that.



However, my main problem is that we ship this particular product as a merge module, and I don't think I can have our customers do it this way. The merge module gets into MSIs made with different tools: IShield, WiX, etc., not just Wise; and our customers probably won't go for wrappers, anyway. There's a better chance we can get customers to change the sequencing of RemoveExistingProducts.



As in first post, I can't really remember why we moved REP to the front of the upgrade, but I'm thinking that it might have been to avoid a problem we later fixed (we had to run a CA to remove a device before running the CA to install it again). So maybe we can put REP after InstallFinalize now. I'm still reading the logs from the successful experiment upgrade with REP at the end, and haven't seen any deal-breakers yet.



Thanks again!

Bill MacEachern's picture
01
Oct
2008
0 Votes 0
Login to vote

Could you not generate a new file from the old source with a bumped version, MYFILE 5.1 instead of MYFILE 4? Even though it is a copy of a previous version, MSI will see it as newer.

Alan Sinclair 2's picture
01
Oct
2008
0 Votes 0
Login to vote

Good idea! I can do that before releasing the msm.



But it's got me thinking about moving RemoveExistingProducts after InstallValidate because it might help with my yesterday question "resume an upgrade after a reboot". If REP was at the end of install then files would not have been removed before the rollback that asks for a restart (which is what customers are griping about, in a different product of ours that also uses our merge module.)