SdFeatureDialog

InstallShield 2014 » InstallScript Language Reference

Project: This information applies to the following project types:

InstallScript
InstallScript MSI

The SdFeatureDialog function creates a dialog that displays a list of features in the setup that the user can install and the amount of disk space that each feature occupies. This function is identical to SdFeatureDialogAdv.

The end user can change the destination folder by clicking the Browse button and can check the available disk space on other drives by clicking the Disk Space button.

Syntax

SdFeatureDialog ( szTitle, szMsg, svDir, szFeatures );

Parameters

SdFeatureDialog Parameters

Parameter

Description

szTitle

Specifies the title of the dialog. 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 name of the folder to be selected by default and returns the name of the folder selected by the end user. The destination folder specified by svDir is not assigned automatically to INSTALLDIR, TARGETDIR, or any other system variable. To apply the value of svDir to the installation, you must assign it to INSTALLDIR (in an InstallScript MSI installation), TARGETDIR (in an InstallScript installation), or to a script-defined variable, if one is in use.

If the default folder specified by svDir does not already exist on the end user's system, it is not 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.

szFeatures

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

SdFeatureDialog searches for the requested features in the script-created feature set specified by the system variable MEDIA; see the Additional Information section.

Return Values

SdFeatureDialog Return Values

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.

Additional Information

To view an example of this or other dialogs for your installation, use the Dialog Sampler. In InstallShield, on the Tools menu, point to InstallScript, then click Standard Dialog Sampler or Skinned Dialog Sampler.
A feature's size is displayed as 0 until it is selected. Once it has been selected, its actual size is displayed.
The required disk space that is displayed by the dialog includes the size of the files that must be installed to enable maintenance and uninstallation. If all application components are deselected, the size of these files is still displayed.
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 before calling SdFeatureDialog.
SdFeatureDialog operates on the current media, which is specified by the system variable MEDIA. During setup initialization, the installation assigns to MEDIA a media name that is associated with your file media library (Data1.cab).

To display script-created features:

1. Save the current value of MEDIA in a string variable, for example, szSaveMEDIAValue.
2. Assign to MEDIA the name of the script-created component set.
3. Call SdFeatureDialog to get end-user selections.
4. Assign to MEDIA the value that you saved in step 1. You must do this before calling FeatureTransferData.
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. 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 feature names appear complete, make feature names or display names smaller than the space available in the dialog.

The Available Disk Space dialog cannot be displayed with a skin; it appears the same regardless of whether you have specified a skin.
The Disk Space button has an ID of 101. This button automatically displays the available disk space dialog. You can remove this button/option if you prefer. The Directory static field requires an ID of 851. The list box ID has a multiple selection style.
In installations that were created with early versions of InstallShield Professional, when the end user selected in the Choose Folder dialog a folder that did not exist, a confirmation message box was displayed asking whether the folder should be created. This message box proved to be confusing to many end users, so it has been removed from InstallShield.

See Also