Setup Prerequisites vs. Feature Prerequisites

InstallShield 2015

Project: Basic MSI projects include support for feature prerequisites.

The following project types include support for setup prerequisites but not feature prerequisites:

InstallScript
InstallScript MSI

An InstallShield prerequisite that is run before the main installation’s user interface sequence begins is called a setup prerequisite. Setup prerequisites are useful for base applications and technology frameworks that must be installed for all configurations of the installed product or that provide functionality that is used during the installation itself. When you add an InstallShield prerequisite to a project, it is the setup prerequisite type of InstallShield prerequisite by default.

Basic MSI projects enable you to associate InstallShield prerequisites with features in your main installation. When an InstallShield prerequisite is associated with one or more features, it is called a feature prerequisite. Feature prerequisites are installed after an end user has chosen which features to install; like merge modules, a feature prerequisite is installed only if one or more of the features that contain it are installed. Thus, feature prerequisites are useful for applications or components that are used by only some configurations of the installed product and are not used during the installation itself.

Review the following sections for more information that will help you determine which type of InstallShield prerequisite will best fit your requirements.

Special Considerations for Setup Prerequisites

Following are some tips to consider if you are including one or more setup prerequisites in your project.

.NET Framework Requirements

If your product requires that the .NET Framework be installed on the target system, you may include the .NET Framework redistributable to your project. If the target system does not have the .NET Framework, it is installed during your installation. For more details, see Adding .NET Framework Redistributables to Projects.

If your installation includes the .NET Framework redistributable and a setup prerequisite that requires that the .NET Framework be present on the target machine—for example, if it installs files to the GAC—you can specify that the .NET Framework should be installed before the setup prerequisite is installed. To learn more, see Specifying Parameters for Installing an InstallShield Prerequisite.

Displaying an Error If an End User Launches the .msi Package Instead of the Setup Launcher

If your Basic MSI or InstallScript MSI installation includes a setup prerequisite and end users launch the .msi package for your product directly, rather than launch the Setup.exe setup launcher, the setup prerequisite installation will not run. If the prerequisite is not already present on a target system, your product may not work as expected. This scenario may occur if you build an uncompressed release, where the .msi package is not streamed into the Setup.exe file.

To prevent this issue from occurring, you may want to add a type 19 custom action to your Basic MSI or InstallScript MSI project. This custom action would evaluate the same conditions that were configured for the prerequisite on the Conditions tab in the InstallShield Prerequisite Editor. The custom action would verify whether the setup prerequisite is still needed; if it is needed, the type 19 error custom action would display an error message and end the installation.

Special Considerations for Feature Prerequisites

Following are some tips to consider if you are including one or more feature prerequisites in a Basic MSI project.

Windows Installer Requirements

If your project includes a prerequisite that installs the Windows Installer, the prerequisite should be a setup prerequisite, not a feature prerequisite. That is, this prerequisite should not be associated with a feature.

.NET Framework Requirements

If your project include a prerequisite that installs the .NET Framework and your installation requires that the .NET Framework be present—for example, if your installation installs files to the GAC—the .NET Framework prerequisite should be a setup prerequisite, not a feature prerequisite. That is, this prerequisite should not be associated with a feature.

Potential Restart Issues for Feature Prerequisites

If you add an InstallShield prerequisite to your project and it may require a restart, it is recommended that you avoid associating the prerequisite with a feature. If a feature prerequisite does trigger a restart, the ReadyToInstall dialog is displayed again after the restart, and the end user will need to click the Install button again to proceed with the rest of the installation.

Calculations for Disk Space Requirements

When the Windows Installer performs the file costing–related actions, it does not automatically include the disk space that is required by any feature prerequisites. Therefore, if the CustomSetup dialog is displayed at run time, the disk space amounts that are listed for various features may be inaccurate, since they will not account for the disk space that is required by feature prerequisites. In addition, it is possible that a target system may have sufficient disk space for the main installation, but not for the feature prerequisites. In this scenario, the target system may run out of disk space midway through the installation.

To prevent file-costing issues for a feature prerequisite in your project, you may want to add a custom action that evaluates the same conditions that were configured for the feature prerequisite on the Conditions tab in the InstallShield Prerequisite Editor. This custom action would detect whether the feature prerequisite needs to be run if its associated feature is selected to be installed. If the feature prerequisite would need to be run, the custom action would add a temporary row to the ReserveCost table.

See Also