Example

SilentWriteData

InstallShield DevStudio » InstallScript Language Reference

The SilentWriteData function records selections made in custom dialogs during the setup. This selection data is written to an .iss file for use by InstallShield Silent. To write to an .iss file during a setup, run the setup using the -r switch with Setup.exe.

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 SilentWriteData to record the dialog's button return value (Next, Back, Cancel, and so on) and any values set or returned in variables.

Syntax

SilentWriteData ( szSection, szValName, nValType, szVal, nVal );

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” for 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 szVal or nVal, 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 szVal.
DATA_NUMBER The value assigned to the value name in szValName is of type NUMBER. Its value will be stored in nVal.
DATA_COMPONENT The value assigned to the value name in szValName is the name of a component. It will be stored in szVal.
DATA_LIST The value assigned to the value name in szValName is the list ID for an InstallShield DevStudio list. It is stored in nVal.
szVal Specifies the value assigned to the value name in szValName when nValType is DATA_STRING or DATA_COMPONENT.
nVal 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 wrote the dialog data for the custom dialog box to Setup.iss.
< 0 SilentReadData was unable to write the dialog data for the custom dialog box to Setup.iss.

See Also