Example
SilentReadData
InstallShield DevStudio » InstallScript Language Reference
The SilentReadData function instructs InstallShield Silent on how to read the .iss file dialog data for a custom dialog box when a setup 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 setup 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 dialog boxes can be resources that you call and handle in your setup 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
| 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 box function as it is used in the script, and <number> is the number of the occurrence of that dialog box in the script, beginning with 0 (zero). For example, the first occurrence of the MyDialog function dialog box 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 box button controls (BACK, NEXT or OK, or CANCEL). Other value names are used to identify values and data associated with the other dialog box 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
| Return Value |
Description |
| 0 |
SilentReadData successfully instructed InstallShield Silent on how to read the dialog data for the custom dialog box. |
| < 0 |
SilentReadData was unable to instruct InstallShield Silent on how to read the dialog data for the custom dialog box.

SilentReadData fails (returns less than zero) under the following conditions:
- The .iss file is not found.
- The dialog sequence in the script does not match exactly the dialog sequence specified in the .iss file.
- The specified dialog data section is not found in the .iss file.
- The specified keyname is not found in the specified dialog data section.
- The data type of the value assigned to the specified keyname does not match that specified in the call to SilentReadData.
|
See Also
SilentReadData Example
EzDefineDialog
SilentWriteData
WaitOnDialog
|