Product Identification (ProductCode and UpgradeCode)

ProductCode

The ProductCode property is a unique GUID used to identify your application. This identifier varies from version to version of the same installer. We recommend using the same ProductCode for each language of your installer : FAQ : Why do I need to set the same Product Code for each language of a package?

NoteIf you have an application, for example, a dictionary or translation app, and you want each language installed/uninstalled separately, then it's recommended that you use different product codes for each package.

Also, it is important to note that two products with the same ProductCode can not be installed on the same computer. Windows Installer will prevent this with an error reading:

Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Programs and Features in the Control Panel.

The ProductCode property is stored within the .aip project file.

UpgradeCode

Unlike the ProductCode, the UpgradeCode is a GUID representing a related set of products. A set of different versions of your application will have the same UpgradeCode. This enables newer versions of your application to search and upgrade previous versions installed on the same computer.

The UpgradeCode property is stored within the .aip project file.

PackageCode

This is not to be confused with the ProductCode property. Although it is a GUID, the package code is not a property referring to a version of your product. It is more specific than that, meaning it refers to the particular .msi file generated. A new PackageCode is generated each time you build your project. Think of the PackageCode as some sort of checksum. No two .msi files should ever have the same PackageCode unless they are identical.

A common instance in which the PackageCode can be seen in action is when your product has already been installed on the machine. Suppose the user would then double-click the installer again. Windows Installer will check the installer's ProductCode to see if the product has been installed on the machine. Since it was, Windows Installer will find it and then check the PackageCode of the installed product. One of two things can happen:

  • should the PackageCode found be identical with the PackageCode of the installer double-clicked by the user, Windows Installer will run the installer in maintenance mode and the user will then be presented with choices to alter the installed product, repair it or remove it (done through the MaintenanceTypeDlg).
  • should the PackageCode found be different than the PackageCode of the installer double-clicked by the user, Windows Installer will display the error mentioned in this article's "ProductCode" section.

The PackageCode property is NOT stored within the .aip project file. It is instead generated each time you rebuild your project.

Copying your project files

Should you ever feel the need to use one of your projects as a base for another project, we strongly encourage you to save your project as a template and then open it through the Custom Templates tab.

We strongly advise against starting a new project from a copied .aip project file. This is because the ProductCode and UpgradeCode properties are stored in it. You would then end up working on two products having the same ProductCode and UpgradeCode. When you would then try to install both products on the same machine, you would encounter the error discussed in this article's "ProductCode" section.

Advanced Installer provides you with the possibility to generate new ProductCodes and UpgradeCodes for your project. This can be done through selecting Project->Options->Project IDs. On this tab you can generate new codes for your project. This is an easy fix should you ever find yourself having two projects with the same ProductCode and UpgradeCode.