Out with the old and in with the new – making your .msi’s do double duty.
The Upgrade table is one of the most useful and maybe most under-utilized capabilities in the Windows Installer format. It gives you the ability to uninstall an older version of software at the same time the new version is installed. Here is how it works:
LetÂ’s say you have created .msi's for SpyBot 1.2 and for SpyBot 1.4. When an .msi is generated, an upgrade code GUID (not to be confused with a product code GUID) is automatically generated (In Wise, the upgrade code is found in the UpgradeCode property, which is in the Properties icon on the Product tab in Setup Editor). LetÂ’s also say that you have placed the upgrade code for your SpyBot 1.2 package in the Upgrade table of your package for 1.4. Now letÂ’s say you run the SpyBot 1.4 .msi on a machine on which the 1.2 .msi is installed. The Windows Installer service will check the machine for the SpyBot 1.2 upgrade GUID, see that it exists, and automatically uninstall it.
Rows can be manually added to the Upgrade table to accomplish this, but products like Wise Package Studio also provide wizards that make the process very fast and easy. In Wise, open the Windows Installer Editor, select the Installation Expert tab, then scroll down on the left to the Distribution section. There you will find the Upgrade tool. Simply follow the prompts, and the proper entries are made for you. Then go to the Setup Editor page, select the Tables tab, and scroll down on the left to find the Upgrade table. Look on the right, and you will see row that has been added per the information you provided.
When using the Upgrade functionality of .msiÂ’s, it is important to think ahead and plan carefully. A great tip by MSImaker here should be considered:
http://itninja.com/blog/view/at-command-line-problems-after-ie-4+7
Comments