Installshield Product Code
InstallShield Product Code
An InstallShield Product Code is a unique identifier used by Windows Installer-based setup packages to represent a specific product. It is a GUID (Globally Unique Identifier) that the Windows Installer and authoring tools like InstallShield use to track installed applications, manage upgrades, detect product presence, and ensure correct maintenance and removal operations.
Purpose and role
- Unique product identity: The Product Code distinguishes one product from another. Two MSI-based installers with different Product Codes are treated as different products by Windows Installer.
- Upgrade management: Major upgrades typically require changing the Product Code. This signals Windows Installer to treat the new package as a different product, enabling automatic removal of the old product and installation of the new one.
- Patch and minor updates: For small updates or patches (minor upgrades), the Product Code usually remains the same while the Package Code changes; this allows inplace updates without treating the package as a different product.
- Maintenance operations: The Product Code ties registry entries, installed files, and component reference counts to a product so uninstall, repair, and modify operations function correctly.
Step-by-Step for a Major Upgrade:
- Keep the Upgrade Code identical to previous versions.
- Increment the Product Version (e.g., from
1.0.0 to 2.0.0).
- Change the Product Code to a new GUID.
- In the Upgrades view, add a new upgrade item.
- Under Upgrade Criteria, select "Detect and remove older versions."
- Set the Maximum Version to your new version number (exclusive or inclusive as needed).
When a user runs the new MSI, Windows Installer sees: "Upgrade Code matches an existing product, but Product Code is different." It then uninstalls the old product (using its old Product Code) and installs the new product. installshield product code
Registry and filesystem locations
- Product information stored under:
- HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\UninstallProductCode
- For 32-bit on 64-bit systems, HKLM\SOFTWARE\WOW6432Node... variants.
- MSI cache: Windows keeps cached copies in C:\Windows\Installer keyed by PackageCode and product info; ProductCode appears within MSI database tables.
DO Change the Product Code (Major Upgrades)
If you are releasing a Major Upgrade (e.g., version 1.0 to 2.0, or significant architectural changes), you must generate a new Product Code. InstallShield Product Code An InstallShield Product Code is
- Why? You want Windows to treat this as a completely separate product.
- Behavior: This allows Version 1.0 and Version 2.0 to exist side-by-side (if desired), or allows the new installer to cleanly uninstall the old version and install the new one (via the Major Upgrade rule).
Best Practice for CI/CD:
Keep your Upgrade Code constant. Store it as a project setting. Use a build script to: Unique product identity: The Product Code distinguishes one
- Read the current Product Code from version control.
- Generate a new Product Code if the version number has changed (SemVer logic).
- Inject the new GUID using a pre-build PowerShell script.
Key Points About Product Code
| Aspect | Detail |
|--------|--------|
| Purpose | Identifies the product for Windows Installer |
| Change required? | For major upgrades only (not minor updates or patches) |
| Location in IDE | General Information > Product Code |
| Related codes | Upgrade Code (permanent, identifies product family)
Package Code (changes with every build) |
4. How to Manage Product Codes in InstallShield