Run-Time Requirements for Managed-Code Custom Actions

InstallShield 2015

Project: This information applies to the following project types:

Basic MSI
DIM
InstallScript MSI
Merge Module

The managed-code type of custom action requires the Microsoft .NET Framework on the target system.

InstallShield includes redistributables for the .NET Framework. If it is possible that target systems may not have the .NET Framework, you can add the appropriate .NET Framework redistributable to your project. For instructions, see Adding .NET Framework Redistributables to Projects.

You can use the property IS_CLR_VERSION to identify a semicolon-delimited list of .NET Framework versions that the custom action should attempt to load to run your managed code. In most scenarios, this property is not set in the installation package. It is set at the command line. To specify that version 1.1 is required, use the following command-line parameter:

IS_CLR_VERSION=v1.1.4322

Note that the complete version number of the .NET Framework should be specified for the property value. If more than one version is acceptable, you can specify a semicolon-delimited list of versions. The first one that can be loaded is used. For the following example command-line parameter, the custom action attempts to load version 2.0. If that version is not present, the custom action attempts to load version 1.1. If version 1.1 is not present, the custom action fails.

IS_CLR_VERSION=v2.0.50727;v1.1.4322

To specify that the custom action should attempt to load whatever is the latest version of the .NET Framework that is installed if none of the specified versions are installed, add a semicolon to the end of the property value, as shown in the following example:

IS_CLR_VERSION=v2.0.50727;v1.1.4322;

The semicolon at the end of the property value also indicates that if none of the specified versions are present but a version of the .NET Framework is already loaded, the custom action uses the currently loaded version, even if it is not the latest version that is installed.

Note: If the execution of your managed-code custom action is set to deferred mode, you must use the Windows Installer property CustomActionData to pass the IS_CLR_VERSION property and value. To learn more, see Specifying the Signature for a Managed Method in an Assembly Custom Action.

Tip: If issues with the custom action occur at run time because of .NET Framework version mismatches, you may want to instruct end users to set the IS_CLR_VERSION property at the command line when they run your installation. Note that for deferred custom actions, you must have already used the CustomActionData property to pass the IS_CLR_VERSION property. For more information, see Specifying the Signature for a Managed Method in an Assembly Custom Action.

See Also