SilentReadData

InstallShield 2014 » InstallScript Language Reference

The SilentReadData function instructs InstallShield Silent on how to read the .iss file dialog data for a custom dialog when an installation runs in silent mode (when using the -s switch with Setup.exe). Note that you can create an .iss file by calling SilentWriteData.

To use SilentReadData in your script, construct the logic so that it first checks to make sure that the installation is running in silent mode. Place the SilentReadData function call inside an if-else statement, based on a test of the system variable MODE, as shown below:

    if (MODE=SILENTMODE) then

        // Call SilentReadData here

    else

        // Make a normal, non-silent function call here

    endif;

Custom dialogs can be resources that you call and handle in your installation script using functions like EzDefineDialog and WaitOnDialog, or they can be completely external, executed as calls to functions in DLLs. In either case, you must use SilentReadData to retrieve from the .iss file the dialog button’s return value (Next, Back, Cancel, and so on) and any values set or returned in variables.

Syntax

SilentReadData (szSection, szValName, nValType, svVal, nvVal);

Parameters

SilentReadData Parameters

Parameter

Description

szSection

Specifies the name of the dialog data section in the .iss file. Do not include the square brackets ( [ ] ). The parameter szSection takes the form <functionname>-<number>, where <functionname> is the name of the dialog function as it is used in the script, and <number> is the number of the occurrence of that dialog in the script, beginning with 0 (zero). For example, the first occurrence of the MyDialog function dialog would have a value of "MyDialog-0" in szSection, the second occurrence "MyDialog-1," the third "MyDialog-2," and so on.

szValName

Specifies the value name that appears in the dialog data section of the .iss file. Every dialog has at least one value for szValName—"Result"—which identifies the value returned by the dialog button controls (BACK, NEXT, OK, or CANCEL). Other value names are used to identify values and data associated with the other dialog controls.

nValType

Identifies the data type of the value assigned to the value name in szValName. The value itself is stored in either svVal or nvVal, depending upon the value of nValType. Pass one of the following predefined constants in this parameter:

DATA_STRING—The value assigned to the value name in szValName is of type STRING. Its value will be stored in svVal.
DATA_NUMBER—The value assigned to the value name in szValName is of type NUMBER. Its value will be stored in nvVal.
DATA_COMPONENT—The value assigned to the value name in szValName is the name of a component It will be stored in svVal.
DATA_LIST—The value assigned to the value name in szValName is the list ID for an InstallScript list. It will be stored in nvVal.

svVal

Specifies the value assigned to the value name in szValName when nValType is DATA_STRING or DATA_COMPONENT.

nvVal

Specifies the value assigned to the value name in szValName when nValType is DATA_NUMBER or DATA_LIST.

Return Values

SilentReadData Return Values

Return Value

Description

0

SilentReadData successfully instructed InstallShield Silent on how to read the dialog data for the custom dialog.

< 0

SilentReadData was called in an installation that is not running silently.

Note: If SilentReadData cannot read the custom dialog data in the response file, the installation is aborted.

See Also