Preventing the Current Installation from Overwriting a Future Major Version of the Same Product

InstallShield 2012 Spring

Project: This information applies to the following project types:

Basic MSI
InstallScript MSI

To prevent end users from being able to install the current version of your product over a future major version of the same product, the Upgrades view should contain a major upgrade item, the major upgrade item should be properly configured to prevent the current version of your product from being installed over a future version, and your project should include a properly configured and scheduled type 19 custom action.

When you create a new Basic MSI or InstallScript MSI project, InstallShield automatically adds support for preventing the current installation from overwriting a future major version:

The Upgrades view contains a major upgrade item called ISPreventDowngrade.

The Products sharing my Upgrade Code option is selected on the Common tab of the major upgrade item. The value of the Upgrade Code setting on the Advanced tab is {000000000000-0000-0000-0000-00000000}. When you build a release, InstallShield uses the release's upgrade code (set in the General Information view, or overridden for the release's product configuration in the Releases view) for the major upgrade item.

InstallShield sets the Detect Property setting of this major upgrade item to ISFOUNDNEWERPRODUCTVERSION and configures the other settings as appropriate.

The Custom Actions and Sequences view contains a custom action called ISPreventDowngrade, a type 19 custom action that Windows Installer launches when an end user tries to install the current version of your product over a future major version.

InstallShield schedules the ISPreventDowngrade custom action for the user interface and execute sequences of the installation sequence so that Windows Installer runs it if appropriate, regardless of what user interface level is used. In addition, InstallShield uses ISFOUNDNEWERPRODUCTVERSION as the condition for this custom action.

The following instructions explain how to manually add this support for projects that you created in InstallShield 12 or earlier and then upgraded to InstallShield 2012 Spring.

To manually add support for preventing end users from being able to install the current version of your product over a future major version:

1. Use the Upgrades view to add a major upgrade item to your project.
2. On the Common tab, select the Products using my Upgrade Code option.
3. Configure the settings on the Advanced tab for the major upgrade item as follows:
a. In the Minimum Version setting, specify the product version that you are using for your current project.
b. Leave the Maximum Version setting blank. If a value is listed for this setting, delete it.
c. If your project includes multiple languages, specify the language identifiers in the Language setting.
d. In the Detect Only setting, select Yes; for all of the other Yes-No settings, select No.
e. In the Detect Property setting, type a descriptive name such as the following one:

FOUNDNEWERVERSION

4. Add and schedule a type 19 custom action for your project to handle scenarios where an end user tries to install the current version of your product over a future major version:
a. In the Custom Actions and Sequences view, right-click the Custom Actions explorer and click New Error.
b. Select the new custom action.
c. In the Error Message setting, type the error message text that should be displayed when an end user tries to install the current version of your product over a future major version.
d. In the Install UI Sequence and Install Exec Sequence settings, select After FindRelatedProducts.
e. In the Install UI Condition and Install Exec Condition settings, type the value that you specified in step 3e.

See Also