# What is a Major Upgrade?

The Windows Installer documentation describes a major upgrade as a comprehensive update of the product that warrants a change in the ProductCode property. While being technically accurate, this statement does little to further your knowledge about how major upgrades actually function. Therefore, this help topic will attempt to address that.

## How do you get a major upgrade to work?

As the Windows Installer help implies, you must change the ProductCode property for the latest version of your installation in order to perform a major upgrade. You can configure the Product Code setting for your installation in the Product Properties grid of the General Information view.

By virtue of having a unique product code, your latest installation will have its own independent registration with the Windows Installer service on end users¡¯ machines. This means that unless some other step is taken, the Windows Installer installs the latest version of your product independently of any of the previous versions. This may be okay if the two versions of your product can coexist on the same machine, but then that would not be an upgrade. Therefore, for the sake of this discussion, it is assumed that two versions should not coexist on the same machine.

The next step in configuring an installation to perform a major upgrade is to use the Upgrades view to specify any previous versions that you want to upgrade. There are two ways to do this using the Upgrades view. The first is to create an automatic upgrade item, and give it the path to the previous version of your installation. The build engine then analyzes the automatic upgrade item and creates all of the settings that are required to upgrade that version of your product.

The second way to indicate your previous version is to create a major upgrade item. A major upgrade item gives you finer control over which previous versions are upgraded. With a single upgrade item, you can potentially target multiple previous versions.

You must also have a unique product version for your upgrade installation. You can update the product version from the Product Properties grid of the General Information view. Note that only the first three version fields are used in product version comparisons. Therefore, changes to the fourth field in a product version do not result in a unique product version number.

## What does a major upgrade look like at run time?

When an earlier version of the product is not available on the target machine and the end user runs a major upgrade, the installation behaves as a first-time installation.

If an earlier version of the product does exist on the target machine and the end user runs a major upgrade, they encounter almost the exact same installation experience as if they were to install the latest application on a clean target machine. The difference is that before installing its new resources, the installation typically uninstalls the earlier version from the target machine. This removal is reflected in the progress bar of the Setup Progress dialog, which gives end users the ability to see the progress of the uninstallation. After the removal of the previous installation has completed, the resources from the latest installation are then installed onto the target machine.

This type of upgrade is a complete uninstallation and then reinstallation of all of the resources associated with your application. Therefore, any data for your application that has been configured by the end user may be completely deleted from the end user¡¯s machine. If you need to retain some of the end-user data, create a custom action that backs up this data and then replaces it after the installation of new data has completed.