# When should I change the Product Code?

This seemingly innocent question has very far-reaching implications because of what changing the Product Code implies. By changing the Product Code of a setup, you are asking the Windows Installer service to recognize the latest application as a product independent of any of its predecessors.

On the topic of Upgrades, changing or not changing the product code is the difference between performing a Major or a Minor upgrade. These upgrade styles vary greatly from one another. Therefore, changing your product code should be done with care and full knowledge of how it affects your upgrade path. You can start to gather this information by reading the topics "What Is a Major Upgrade" and "What Is a Minor Upgrade". This topic is intended to help you determine when to use one upgrade type over another.

The following conditions require you to change your Product Code:

- The latest version of your application must be able to coexist with previous versions of your application.

  This technically is not an upgrade scenario, but it is a case where you would want to change the Product Code. With a unique Product Code, the Windows Installer will register the latest version of your application separately from a previous version of your application.

- The name of the MSI package has changed.

  An error will occur while installing files during a Minor Upgrade if your MSI package name has changed. To avoid this error, you must change the Product Code, and perform a Major Upgrade.

- You have deleted a component or feature from your existing setup architecture.

  If you move a component from one feature to another or if you move a feature to another location in the setup hierarchy, then you are essentially "deleting" that item from its original location and adding it to its new location. Therefore, you must change the Product Code and do a Major Upgrade.

  Windows Installer registers components based on their Component Code or ComponentID. Therefore, if this Component Code changes, the component will appear to have been "deleted".

  You can add new features and components without changing the Product Code, as long as you do not delete existing features or components.