Major Upgrades

InstallShield DevStudio

The Windows Installer documentation describes a Major Upgrade as "a comprehensive update of the product that warrants a change in the ProductCode property." While 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 Major Upgrades Work

As the Windows Installer help implies, you must change the ProductCode for the latest version of your setup in order to perform a Major Upgrade .

Note

You can set the Product Code for your setup in the Product Properties grid of the General Information view. It does not matter what the new Product Code is, as long as it is unique.

By virtue of having a unique ProductCode, your latest setup will have its own independent registration with the Windows Installer Service on your customer's target machine. This means that unless some other step is taken, the Windows Installer will install the latest version of your setup independently of any of the previous versions of your setup. This may be OK if these two versions of your application can coexist on the same machine, but then that would not be an upgrade. Therefore, for the sake of this topic, we will assume that it cannot.

The next step in configuring a setup to perform a Major Upgrade is to 'Register' any previous version's setup versions that you want to upgrade in the Upgrade view. There are two ways to do this using the Upgrade view in the IDE. The first is to create an Automatic Upgrade Item, and give it the path to the previous version of your setup. The build engine will then analyze the Automatic Ugprade Item, and create all of the settings required to upgrade that setup.

The second way to register your previous version is to create a Major Upgrade Item. A Major Upgrade Item gives you finer control over which previous versions will get upgraded. With a single upgrade item, you can potentially target multiple previous versions.

If you intend to distribute this Major Upgrade as a patch, you must also have a unique Product Version. You can update the Product Version for your setup 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 will not result in a unique Product Version number.

Major Upgrades at Run Time

When a previous setup exists on the target machine and you run a major upgrade the user will encounter almost the exact same setup experience as if they were to install your latest application on a clean target machine. The difference is that before installing its new resources, the setup will first remove the old setup and its resources from the target machine. This removal is reflected in the progress bar of the Setup Progress dialog giving your user the ability to see the progress of the uninstallation. After the removal of the previous installation has completed, the resources from the latest installation will then be 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 you application that has been configured by the user may get completely deleted from the user's machine. If you need to retain some of your user data, you will need to create a custom action that backs up this data, and then replaces it after the installation of new data has completed.

See Also