SdAskOptions

InstallShield 2014 » InstallScript Language Reference

Project: This information applies to the following project types:

InstallScript
InstallScript MSI

The SdAskOptions function creates a dialog that offers installation options. You can use check boxes or option buttons as the selection mechanism. The information shown beside the button is retrieved from a group of options. The default number of options is four. You can add or subtract the number of options as necessary in the group.

Syntax

SdAskOptions ( szTitle, szMsg1, szMsg2, szId, szFeatures, nExclusiveFlag );

Parameters

SdAskOptions Parameters

Parameter

Description

szTitle

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

szMsg1

Specifies a message to display in the dialog. This static field has an ID of 801. To display the default instructions for this dialog, pass a null string (“”) in this parameter.

szMsg2

Specifies a second message to display in the dialog. This static field has an ID of 802.

szId

Specifies an alternate numeric dialog ID. Use only numeric IDs expressed in string form (for example, ID 13001 as “13001”). You can copy the SdAskOptions dialog resource, make limited changes to it, give it a unique numeric ID, and call that dialog by passing its ID as a string in szId. (See above.) To create the standard four-option SdAskOptions dialog, pass a null string (“”) in this parameter.

szFeatures

Specifies the name of the feature that contains the subfeatures to be displayed. The subfeatures are preceded by check boxes or option buttons. To display all top-level features, pass a null string (“”) in this parameter.

SdAskOptions searches for the requested features in the file media library or script-created feature set specified by the system variable MEDIA.

nExclusiveFlag

Specifies the type of button you want to display in the dialog. Pass one of the following predefined constants in this parameter:

EXCLUSIVE—Specifies option buttons.
NONEXCLUSIVE—Specifies check boxes.

Return Values

SdAskOptions 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.
If your setup includes required, visible components, do not call SdAskOptions to obtain installation options. Instead, call FeatureDialog, SdFeatureDialog, SdFeatureDialogAdv, SdFeatureMult, or SdAskOptionsList in nonexclusive mode.
If your setup does not use a setup type dialog, you must call FeatureSetupTypeSet to specify a setup type that has been defined in the IDE's Setup Types view before calling SdAskOptions.
SdAskOptions 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 SdAskOptions to get end-user selections.
4. Assign to MEDIA the value that you saved in step 1. You must do this before calling FeatureTransferData.

You can create more than one dialog of the SdAskOptions type by copying the SdAskOptions dialog resource (located in _isres.dll) using a resource editor, making limited changes to the copy, and giving it a unique ID. You should save the copy to _isuser.dll. When you call SdAskOptions and pass the ID of the customized copy of the dialog in the parameter szId, the customized copy is displayed. Limit your changes to editing existing static text fields and adding static text fields. Adding controls that require handling is not recommended because it requires changing the SdAskOptions source script.

See Also