What is product code in windows installer

Product Codes

The product code is a GUID that is the principal identification of an application or product. For more information, see the ProductCode property. If significant changes are made to a product then the product code should also be changed to reflect this. It is not however a requirement that the product code be changed if the changes to the product are relatively minor.

The 32-bit and 64-bit versions of an application’s package must have different product codes. If any 32-bit component of an application is recompiled into a 64-bit component, a new product code must be assigned.

If a server exposed in the PublishComponent Table is recompiled from 32-bits to 64-bits, the GUID in this table may also need to be changed so that 32-bit and 64-bit clients can identify the appropriate qualified component category. In this case, the product code must also be changed.

Note that letters in product code GUIDs must be uppercase. Utilities such as GUIDGEN generate GUIDs containing lowercase letters. The lowercase letters in these GUIDs must be changed to uppercase to be used as a product code or package code. For more information, see Changing the Product Code.

The package code is a GUID identifying a particular Windows Installer package. The package code associates an .msi file with an application or product and can also be used for the verification of sources. The product and package codes are not interchangeable. No two nonidentical .msi files should ever have the same package code. Although it is common to ship an application that has the same package code and product code, the two values can diverge as the application is updated. For more information, see Package Codes.

Find your Windows product key

A Windows product key is a 25-character code used to activate Windows. It looks like this:

PRODUCT KEY: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

Locate your product key for Windows 10

Depending on how you got your copy of Windows 10, you’ll need either a 25-character product key or a digital license to activate it. A digital license (called a digital entitlement in Windows 10, Version 1511) is a method of activation in Windows 10 that doesn’t require you to enter a product key. Without one of these, you won’t be able to activate your device.

Where to find your product key depends on how you got your copy of Windows.

Select any of the following to see more information:

The product key is preinstalled on your PC, included with the packaging the PC came in, or included on the Certificate of Authenticity (COA) attached to the PC. For more info, contact your hardware manufacturer, and for pictures of authentic product keys and COA labels, see How to tell your hardware is genuine.

The product key is on a label or card inside the box that Windows came in. For more info, contact the retailer that sold you Windows 10. How to tell your software is genuine.

Find your product key in the confirmation email you received after buying Windows 10 or in a digital locker accessible through the retailer’s website.

The product key is in the confirmation email you received after buying your digital copy of Windows. Microsoft only keeps a record of product keys if you purchased from the Microsoft online store. You can find out if you purchased from Microsoft in your Microsoft account Order history.

If you upgraded to Windows 10 for free from Windows 7 or Windows 8.1, you should have a digital license instead of a product key.

If you bought Windows 10 Home, Professional, or Upgrade to Pro in the Windows 10 Store app, you’ll receive a digital license instead of a product key. You can use the digital license for activation.

Читайте также:  Remote desktop connection mac os ppc

If your product key is scratched, blurred, or otherwise unusable, contact the retailer who sold you the product. If you aren’t able to get help from your retailer or have already tried and couldn’t get a working key, call Microsoft Support.

For more information about digital licenses and product keys in Windows 10, see the “Methods of Activation” section in Activate Windows 10.

Locate your product key for Windows 7 or Windows 8.1

A product key is usually required when uninstalling or reinstalling Windows 7 or Windows 8.1. Generally, if you bought a physical copy of Windows, the product key should be on a label or card inside the box that Windows came in. If Windows came preinstalled on your PC, the product key should appear on a sticker on your device. If you’ve lost or can’t find the product key, contact the manufacturer. To ensure your product key is genuine, see How to tell your software is genuine and How to tell your hardware is genuine.

For info about how to tell if your copy of Windows is genuine Microsoft software, see the How to tell page.

For more Windows 10 download info, see Download Windows 10.

If you need installation media to install or reinstall Windows, see Create installation media for Windows to learn how to create your own installation media using either a USB flash drive or a DVD.

If you need more help with activation, see Activate Windows 10.

If you’re getting an activation error, see Get help with Windows activation errors.

If you’re reinstalling Windows 10, you might not need a Windows product key. See Activation in Windows 10 for more info.

If you’re reinstalling Windows 10 due to a motherboard problem or some other hardware issue, see Reactivating Windows 10 after a hardware change.

If you’re looking for product keys for Office, apps, games, and more, see Find your Microsoft downloads and product keys

Package Codes

The package code is a GUID identifying a particular Windows Installer package. The package code associates an .msi file with an application or product and can also be used for the verification of sources. The product and package codes are not interchangeable. For details, see Product Codes.

Nonidentical .msi files should not have the same package code. It is important to change the package code because it is the primary identifier used by the installer to search for and validate the correct package for a given installation. If a package is changed without changing the package code, the installer may not use the newer package if both are still accessible to the installer.

The package code is stored in the Revision Number Summary Property of the Summary Information Stream. Note that letters in product code and package code GUIDs must be uppercase. Utilities such as GUIDGEN generate GUIDs containing lowercase letters. The lowercase letters in these GUIDs must be changed to uppercase to be used as a product code or package code.

Although it is common to ship an application that has the same package code and product code, the two values can diverge as the application is updated. For example, including a new file with the application would require updating the installation database to install the file. If the changes are minor a developer may choose not to change the product code, however, a different .msi file is needed to install the new file and so the package code must be incremented. Conversely, a single package can be used to install more than one product. For example, the installation of a package without a language transform could install the English version of the application and the installation of the same package with a language transform could install the French version. The transform is distinct from the .msi file that determines the package code. The English and French versions could have different product codes and the same package code because they are both installed with the same .msi file.

Читайте также:  Windows one care with

Changing the Product Code

The product code is a GUID that is the principal identification of an application or product. See Product Codes.

An update that meets the following guidelines generally does not require a change of the product code and can be handled as a small update, or if the version is to change, as a minor upgrade:

  • The update can enlarge or reduce the feature-component tree but it must not reorganize the existing hierarchy of features and components described by the Feature and FeatureComponents tables. It can add a new feature to the existing feature-component tree. If it removes a parent feature, it must also remove all the child features of the removed feature.
  • The update can add a new component to a new or an existing feature.
  • The update must not change the component code of any component. Consequently, a small update or minor upgrade must never change the name of a component’s key file because this would require changing the component code.
  • The update must not change the name of the .msi file of the installation package. Instead, because it modifies the package, it should change the package code. Note that this means that the update can change the tables, custom actions, and dialogs in the .msi file without changing the file’s name.
  • The update can add, remove, or modify the files, registry keys, or shortcuts of components that are not shared by two or more features. If the update modifies a versioned file, that file’s version must be incremented in the File table. If the update removes resources, it should also update the RemoveFile and RemoveRegistry tables to remove any unused files, registry keys, or shortcuts that have already been installed.
  • The update of a component that is shared by two or more features must be backward compatible with all applications and features that use the component. The update can modify the resource of a shared component, such as files, registry entries, and shortcuts, as long as the changes are backward compatible. It is not recommended that the update add or remove files, registry entries, or shortcuts from a shared component.
  • A small update is shipped as a Windows Installer patch package. (A full product CD-ROM is usually not provided with a small update.)

The product code must be changed if any of the following are true for the update:

  • Coexisting installations of both original and updated products on the same system must be possible.
  • The name of the .msi file has been changed.
  • The component code of an existing component has changed.
  • A component is removed from an existing feature.
  • An existing feature has been made into a child of an existing feature.
  • An existing child feature has been removed from its parent feature.

Note that adding a new child feature, consisting entirely of new components, to an existing feature does not require changing the product code.

New child features can be authored by including msidbFeatureAttributesFollowParent and msidbFeatureAttributesUIDisallowAbsent in the Attributes field of the Feature table. If the minor upgrade only adds new child features, then REINSTALL=ALL is sufficient to force the installation of the new child features. For more information, see Controlling Feature Selection States.

A new child feature may be hidden from the user. To synchronize the installation state of a new child feature with its parent feature, set the msidbFeatureAttributesFollowParent and msidbFeatureAttributesUIDisallowAbsent bits for the child feature.

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?

Читайте также:  Common error messages windows

If 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.

Оцените статью