InstallShield, Product Codes, Package Codes, and Upgrade Codes, Oh my god!
Aha! You say. Forgot to change the Package code. So a GUID Generate and rebuild later, you try again and this time get this:
You got the Package Code different, Upgrade and Product Code the same in the two versions, and you’ve got a Major Upgrade item setup and configured to recognize the proper Old version number range.
What’s up?
Come to find out, the IS help is a little confused on this topic. When you create a MAJOR UPGRADE to your installation (which, if my experience is any indication, almost EVERY upgrade is a major upgrade), you need to change both the Product Code and the Package Code! But here’s the trick, the Upgrade Code stays the same.
Why? Because appearently, a Major Upgrade is considered an entirely new Product, even though it’s not, because you intend it to upgrade older versions of the product.
But MSI doesn’t use the Product Code for that, it uses the Upgrade Code for that purpose.
So, basic rule is:
When you create a new Version of your app’s installation with InstallShield (or any MSI based Installer, I suspect), be sure to:
- Make sure you have an Upgrade Item setup to recognize the proper version range
- Make sure you generate a NEW PACKAGE CODE guid
- Make sure you generate a NEW PRODUCT CODE guid
- Make sure you DO NOT modify the UPGRADE CODE guid (basically, you almost never modify the Upgrade Code guid)
- Kneel before the holy altar and make an offering to the MSI gods.
Here’s a handy table from a Macrovision support site article that also might help. Basically, it illustrates when a particular code needs to be changed (the X’s), based on what kind of upgrade the new version of your install is.
Update Type | Package Code | Product Version | Product Code | Upgrade Code |
---|---|---|---|---|
Minor Upgrade without Patching | X | |||
Minor Upgrade with Patch | X | X | ||
Major Upgrade | X | X | X |
You know, I whipped out an install in InnoSetup in, like, 5 minutes. And it’s free.