SdOptionsButtons

InstallShield 2014 » InstallScript Language Reference

Project: This information applies to the following project types:

InstallScript
InstallScript MSI

The SdOptionsButtons function displays a dialog that contains from one to four push button controls that have bitmap images. A short text description is displayed next to each control.

Important: Do not change the control identifiers of the push button controls on the SdOptionsButtons dialog, or set one of the push button controls as the default control. If you change the control identifiers or set one of the these controls as the default control of the dialog, the SdOptionsButtons dialog will not work as expected.

Note: Although SdOptionsButtons can be used as a setup type dialog, the SdSetupTypeEx dialog is the recommended dialog for allowing the end user to select a setup type because it does not require any customization. If you call SdOptionsButtons to get the end user’s setup type selection, you must then call FeatureSetupTypeSet to establish the selected setup type for your setup.

Syntax

SdOptionsButtons (szTitle, szMsg, listButton, listDescription);

Parameters

SdOptionsButtons 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 on the dialog. To display the default instructions for this dialog (“Please select the features that you want to install.”), pass a null string ("") in this parameter.

listButton

Specifies a string list that contains from one to four elements. Each element is a formatted string that specifies an image to be displayed on a button. One button is displayed for each string element in the list. The string list elements should have the following format:

@@ResourceID;ScaleFactor

ResourceID indicates the resource identifier number that should be used to look up either a .png image (stored as resource type PNG) or a bitmap image (stored as resource type RT_BITMAP). ScaleFactor indicates the DPI scale percentage for which the image is intended.

For example, the scale factor can be 100% (96 DPI), 125% (120 DPI), 150% (144 DPI), or 200% (192 DPI). If the scale factor that is specified for an image is 200, the image will be shrunk down for display on target systems that are running less than 200% DPI scaling. On a 200% target system, it will be displayed at 1:1. If the scale factor that is specified for the image is100, the image will be scaled up for display on target systems that are running 200% DPI scaling.

listButton (cont.)

The previous format for identifying bitmap images (.bmp) still works, but it does not have support for scaling, or for .png images:

@BitmapResourceID;TransparentFlag;3-DFlag;<unused>;TransparentColorKey

BitmapResourceID indicates the resource identifier number for the bitmap image. TransparentFlag is 1 (true) or 0 (false), indicating whether the color that is specified in the TransparentColorKey field will be transparent when the bitmap is displayed. TransparentColorKey specifies an RGB value that is a transparent color for the bitmap.

InstallShield provides four default bitmaps in _isres.dll that can be used by this function. These bitmaps have IDs of 12001 through 12004 and correspond to the Typical, Portable, Compact, and Custom setup types in the example script. If you are using this dialog for another purpose or if you want to use setup types other than the types provided in _isres.dll, you must to add your own custom buttons to the _isuser.dll dialog template and then include the customized _isuser.dll with your installation.

Tip: To determine the bitmap IDs of bitmap controls created in the Dialog Editor, you need to build your project and open the .rc file to locate the bitmap IDs. The .rc file is located in your project folder (by default, C:\InstallShield 2014 Projects\Your Project Name). Adding additional bitmap controls may change the bitmap IDs. Because of this, you need to rebuild your project and open the .rc file again to find the updated bitmap IDs.

listDescription

Specifies a string list that contains from one to four string elements, each corresponding to a string in the parameter listButton. Each string is a text description to be displayed with its corresponding button.

Return Values

SdOptionsButtons Return Values

Return Value

Description

NEXT (1)

Indicates that the Next button was clicked.

BACK (12)

Indicates that the Back button was clicked.

101

Indicates that the button corresponding to the first string element in listButton was selected.

102

Indicates that the button corresponding to the second string element in listButton was selected.

103

Indicates that the button corresponding to the third string element in listButton was selected.

104

Indicates that the button corresponding to the fourth string element in listButton was selected.

Note: To prevent the user from exiting the dialog without clicking a particular button, call the Disable function to disable the Next button before you call SdOptionsButtons.

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.

See Also