FeatureDialog

Project: This information applies to the following project types:

InstallScript
InstallScript MSI

The FeatureDialog function displays a dialog that enables the end user to select one or more items from a list of features in the installation. The end user can also select a destination location.

When the end user clicks the Browse button, the Choose Folder dialog, which displays a list of existing folders, opens. The end user can select an existing folder from the list or enter a new folder name in the Path field. FeatureDialog returns the name of the specified folder in svDir. If the user specifies a folder that does not currently exist, the installation creates the folder.

Caution: If your installation does not use a setup type dialog, you must call FeatureSetupTypeSet to specify a setup type that has been defined in the Setup Types view in InstallShield before calling FeatureDialog.

Syntax

FeatureDialog ( szTitle, szMsg, svDir, szFeature );

Parameters

FeatureDialog Parameters

Parameter

Description

szTitle

Specifies the dialog title. To display the default title (“Select Features”), pass a null string ("") in this parameter.

szMsg

Specifies the message to display in the dialog. To display the default instructions for this dialog, pass a null string ("") in this parameter.

svDir

Specifies the default destination location variable. Returns the folder selected by the end user. The location returned in svDir does not affect file transfer unless you assign it to TARGETDIR (in InstallScript installations) or INSTALLDIR (in InstallScript MSI installations).

If the default folder specified by svDir does not already exist on the end user’s system, it will not be created unless the end user clicks the Browse button and follows the steps to create it from the Choose Folder dialog. Therefore, whenever you specify a default folder, you must call ExistsDir when FeatureDialog returns in order to determine whether that folder exists. If it does not exist, call CreateDir to create it on the end user’s system.

szFeature

Specifies the feature whose subfeatures are displayed for selection. Pass a null string ("") in this parameter to display all top-level features. To learn how to refer to top-level features and subfeatures, see Specifying Features and Subfeatures in Function Calls.

FeatureDialog searches for the requested features in the script-created feature set specified by the system variable MEDIA.

Note: If necessary, feature names are truncated to allow the display of the largest possible feature size. The space required to display the size depends on the maximum feature size (2 GB), the feature size options currently in use, and the font used to display feature information in the dialog. Feature size options are set with the DialogSetInfo function.

When the space required to display the maximum possible size has been determined, all feature names are truncated automatically—if necessary—to fit the remaining space. This ensures that feature names will not overlap feature sizes.

Note that the name of a feature that requires less space to display its size (or that is not selected) may still be truncated under this method. To maximize performance and ensure that complete feature names are displayed, make feature names or display names smaller than the space available in the dialog.

Return Values

FeatureDialog Parameters

Return Value

Description

NEXT (1)

Indicates that the end user clicked the Next button.

BACK (12)

Indicates that the end user clicked the Back button.

< 0

Unable to display the FeatureDialog dialog. Call FeatureError for additional information.

Additional Information

The Choose Folder dialog indicates the amount of disk space that each feature occupies. A feature's size is displayed as 0 if it is not selected. Once it has been selected, its actual size is displayed.

See Also