Script-Created Feature Set vs. File Media Library

InstallShield 2023 » InstallScript Language Reference

You can create features at run time by calling the FeatureAddItem function in your setup script. These script-created features reside only in memory and have no direct connection to a file media library. Unlike the information stored in a file media library, script-created features are not—and cannot be—directly associated with components or a setup type.

However, script-created features provide a convenient way of displaying feature-like options for the end user. After the end user makes feature selections in feature dialogs, you can test the script-created features' selection status and use the result as the basis for carrying out some action. For example, you might want to install files with XCopyFile or VerUpdateFile, select features in the file media library, or create or edit a file.

Building a Script-Created Feature

To build a new script-created feature, call the FeatureAddItem function. Then, set and access properties for the script-created feature using the InstallScript feature functions much as you would for features in a file media library (exceptions noted below).

Referring to Script-Created Feature Sets

Script-created features are often referred to collectively as a "script-created feature set." The reason is that they are often handled just like file media library features by feature functions. You must treat all features as a set when you pass their media name to the feature functions.

Note:You create the media name in the first parameter of FeatureAddItem. Use this value when you create features and subfeatures as part of the same "script-created feature set" and when you refer to existing script-created features in your script.

Using Feature Functions

Since the two types of features are so different, you call some of the feature functions differently depending on whether you are working with a script-created feature or a feature in a file media library.

File Media Library and Script-Created Feature Set Functions

These functions can be used on both a feature in a file media library or on a script-created feature:

FeatureGetData
FeatureSetData

File Media Library Functions

These functions work only with features in a file media library, but not with script-created features:

$startxml{<a href="../helplibrary/ExpressingLargeNumbers.htm">}$endxmlFeatureCompareSizeRequired
FeatureFilterLanguage
FeatureFilterOS
FeatureSetTarget
FeatureSetupTypeEnum
FeatureSetupTypeGetData
FeatureSetupTypeSet
FeatureTransferData

Script-Created Feature Set Function

The FeatureAddItem function works exclusively with script-created feature sets.