INSTALLSHIELD internal library function 6 custom dialog function

zhaozj2021-02-17  32

INSTALLSHIELD internal library function 6 custom dialog function

The following functions handle the custom dialog process. You use a resource editor to create a dialog and use these functions into the script.

Any Windows dialog you can create can be used in a installation script. The dialog box can have a single or multi-line edit box, a single or multiple selection list boxes, a combo box, a single tab, check box, and press twisting as a standard control. For more complex controls, advanced functions are provided, such as CmdgetHWnddlg, Loword, and Hiword.

Cmdgethwnddlg

Retrieve the handle of a dialog.

Ctrlclear

Delete an editing, static, list box, or combo control.

Ctrldir

Use a list of directory or a list of files to populate a list box or combo box.

Ctrlgetcursel

Select a project from a list box or combo box.

Ctrlgetmletext

Retrieve text from a multi-line editing or static area.

CtrlgetMultcursel

Returns the selected item from a multi-selection list box.

CtrlgetState

Retrieve a single option, check the box, or press the state of the button control from a dialog.

Ctrlgetsubcommand

Retrieves the operation of the control after calling the control after calling the control in a Waitondialog function.

CtrlgetText

Retrieve text from an editing area, a static zone or a combo box.

Ctrlpgroups

Retrieve the list of program groups that exist on the target system.

CtrlSelectText

Select the text displayed in an editing area.

CtrlSetcursel

Find and set the current selection in a list box or combo box.

CtrlsetFont

Specifies the font of a control in the dialog.

Ctrlsetlist

Place the contents of a list in a list box or combo box.

CtrlseTmletext

Set the text in a multi-line editing area.

CtrlseTMultcursel

Set the current selection in a multi-selection list box.

CtrlSetState

Set a check box, a radio button or press the call to change.

CtrlSettext

Set text in an editing area, a static text area, or a combo box.

Definedialog

Register a custom dialog with InstallShield.

EndDialog

Close a custom dialog.

Ezdefinedialog

Register a custom dialog with InstallShield.

GetFont

Retrieve a handler of a font.

HiWord

Retrieve high characters from a 32-bit integer.

Loword

Retrieve low words from a 32-bit integer.

ReleaseDialog

Release a dialog associated memory.

SDMAKENAME

SDMAKENAME creates a section name for a custom dialog. The section is used by writing or from a .iss file or from one .iss file, .iss file is used by InstallShield Silent.

SilentReadData

Indicates InstallShield Silent to read .iss file dialog data for a custom dialog.

SilentwriteData

Indicates InstallShield Silent to write dialog data to a custom dialog to .iss file.

Waitondialog

Display a custom dialog.

6.1 cmdgethwnddlg

Syntax: cmdgethwnddlg (szdialogname);

Description: The cmdgethwnddlg function retrieves the window handle of the dialog that is identified by the szdialogname. The dialog must have been defined by ezdefinedialog (or definedialog) and is initialized by calling Waitondialog.

parameter:

SZDialogname

Specifies the name of the dialog defined by ezdefinedialog (or definedialog).

return value:

> 0: The window handle of the dialog specified by SZDialogname.

<0: cmdgethwnddlg failed to retrieve the handle. Please confirm that SZDialogName points to a dialog that has been correctly defined and has been initialized. annotation:

• When a dialog is initialized with a Waitondialog function, it assigns a window handle; the handle is only associated with the dialog until a call to EndDialog is turned off. If you call Waitondialog to open a dialog box that has been opened and closed in your script, you must call CMDGETHWNDDLG again to get a new handle. The old handle is no longer effective.

· Typically, cmdgethwnddlg is called in a DLG_Init routine of a custom dialog. The handle of the dialog is assigned to the HWND variable to be used for other functions that require it.

6.2 Ctrlclear

Grammar: ctrlclear (szdialogname, nControl);

Description: The Ctrlclear function clears the contents of various controls; it removes a single or multi-line editing area, static text area, single or multi-selection list box or a combination of the editing area of ​​a single line or multi-line editing area, a static text area, a single or multi-selection list box or a combo box.

parameter:

SZDialogname

Specifies the name of the dialog that contains the control to be deleted.

NControlid

Specifies the control ID of the dialog that is identified by the SZDialogName.

return value:

0: Ctrlclear successfully deletes the contents of the specified control.

<0: Ctrlclear has failed to delete the contents of the dialog.

6.3 Ctrldir

Syntax: Ctrldir (SZDILOGNAME, NCONTROLID, SZDIR, NITEMS);

Description: The CTRLDIR function fills a list box or a combination box control with a file list that matches the path or file name specified by SZDIR. You can include file names, sub-directory names, and disk drive names in the list. The CTRLDIR function is only working in the custom dialog.

parameter:

SZDialogname

Specify the name of a dialog.

NControlid

Specify the resource ID of the list box or a combo box control.

SZDir

Specifies a fully qualified path or a fully qualified file name, which can include wildcards.

NITEMS

Specifies the type of the list displayed in the control. One of the following predefined constants in this parameter location is passed. To include multiple element types, these constants are combined with a bit or operator (|):

DLG_DIR_FILE: Create a list of files that match the file description SZDIR.

DLG_DIR_DIRECTORY: Create a list of subdirectories existing in the path description SZDir.

DLG_DIR_DRIVE: Create a list of drives.

return value:

0: Ctrldir successfully fills the control specified in a dialog.

<0: Ctrldir failed to populate the specified control.

6.4 CtrlgetCursel

Syntax: CtrlgetCursel (Szdialogname, NControlID, SVText);

Description: The CtrlgetCursel function retrieves the currently selected item from a single-selection list box or a combo box control in a custom dialog. Call CtrlgetMultcursel to retrieve items from the multi-selection list box.

parameter:

SZDialogname

Specifies the name of the custom dialog that contains the item to be retrieved.

NControlid

Specifies the resource ID of the radio box or a combination box control.

SvText

Returns the currently selected item in the control specified by NControlID.

return value:

0: CtrlgetCursel Successfully Retrieves the currently selected item in the dialog.

<0: CtrlgetCursel failed to retrieve selected items.

6.5 ctrlgetmletext

Syntax: CtrlgetMletext (SZDIALOGNAME, NCONTROLID, LISTID); Description: The CtrlgetMletext function retrieves the content of a multi-line editing control in a custom dialog. InstallShield puts each row in the multi-line editing area into a list of strings identified by the ListID. Call CtrlgetText to retrieve a single line editing area control content.

parameter:

SZDialogname

Specifies the name of a custom dialog that contains multiple line editing controls to be retrieved.

NControlid

Specifies the resource ID of the multi-line editing control.

ListID

Returns a string list of rows in the editing area of ​​the NControlID identity. A list of strings identified by the ListID must have been initialized by calling ListCreate.

return value:

0: CtrlgetMleText successfully retrieves the content of a multi-line editing area.

<0: CtrlgetMleText Fails to retrieve the contents of the control.

6.6 CtrlgetMultcursel

Syntax: CtrlgetMultcursel (SZDIALOGNAME, NCONTROLID, LISTID);

Note: The CtrlgetMultcursel function retrieves the currently selected row in a multi-selection list box control. Each selected row in the multi-selection list box is placed in a string list that is identified by the ListID. To retrieve the selected text from a radio list box control, call CtrlgetCursel. CtrlgetMultcursel is only used in custom dialogs.

parameter:

SZDialogname

Specifies the name of a custom dialog that contains the list box controls to be retrieved.

NControlid

Specifies the resource ID of the multi-line editing control.

ListID

Returns the row in the list box identified by the NControlID. A list of strings identified by the ListID must have been initialized by calling ListCreat.

return value:

0: CtrlgetMultcursel successfully retrieves the currently selected item.

<0: CtrlgetMultcursel failed to retrieve projects.

6.7 CtrlgetState

Grammar: CtrlgetState (szdialogname, ncontrolid);

Description: The ctrlgetState function gets a current state of a check box or a radio button in a custom dialog.

parameter:

SZDialogname

Specifies the name of the dialog that contains the control.

NControlid

Specify the resource ID of the check box or a radio button to be retrieved.

return value:

Button_Checked (-1001): Check box or radio button is selected.

Button_unchecked (-1002): The check box or the radio button is not selected.

DLG_ERR (-1): CtrlgetState cannot determine the status of the control.

6.8 Ctrlgetsubcommand

Grammar: ctrlgetsubcommand (szdialogname);

Note: The CtrlgetSubcommand function retrieves the operations performed on one of a control in a custom dialog. For example, ctrlgetsubcommand can tell you a user clicking or double-click a list box or a combination box control. It can also tell you that the content of an editing area is modified.

Advanced developers can call CMDGETHWNDDLG to process additional information.

parameter:

SZDialogname

Specifies the name of the custom dialog.

return value:

EditBox_change (-1007): The content of the edit box has changed.

Listbox_enter (-1008): Users double-click a list box item.

Listbox_select (-1009): The user clicks a list box item.

6.9 CtrlgetText

Syntax: CtrlgetText (SZDIALOGNAME, NCONTROLID, SVTEXT); Description: The CtrlgetText function retrieves text from an editing area, static text area, or a torsion control in a custom dialog. To retrieve the text from the multi-line editing area control, call CtrlgetMletext.

parameter:

SZDialogname

Specifies the name of a dialog that contains the area or control of its text to be retrieved.

NControlid

Specifies the resource ID of the editing area, static text area, or press the button control.

SvText

The text returned from the control or zone identified by the NControlID.

return value:

0: CtrlgetText successfully retrieves the contents of the control.

<0: CtrlgetText failed to retrieve content.

6.10 CtrlpGroups

Syntax: CtrlpGroups (Szdialogname, NControlid);

Description: The ctrlpgroups function puts an existing program folder list in a list box or combo control. This function is only working on the custom dialog.

parameter:

SZDialogname

Specifies the name of a custom Dialog Box That Contains The Control to Use.

Specify the name of the custom dialog that contains the controls to use.

NControlid

Specify the resource ID of a list box or a combo box control.

return value:

0: CTRLPGroups successfully placed the specified program folder list in the control.

<0: CtrlpGroups Fails to place the specified program folder list in the control.

6.11 CtrlSelectText

Syntax: CtrlSelectText (Szdialogname, NControl);

Description: The CtrlSelectText function selects all the text in the editing area of ​​the editing area or a combo box. If the control is a multi-line editing area, the function selects all the text of all rows. This function is only working on the custom dialog.

parameter:

SZDialogname

Specifies the name of a valid dialog that contains the editing area to be selected.

NControlid

Specifies the resource ID to be selected by the editing area or combination box control.

return value:

0: CtrlSelectText successfully selected all the text in the area.

<0: CtrlSelectText Failed to select text.

6.12 CTRLSETCURSEL

Syntax: CtrlSetcurseel (Szdialogname, NControlID, Sztext);

Description: The CtrlSetCursel function looks up a string in the specified list box or in the combo box control. If found, CtrlSetCursel selected (highlight) the project. CtrlSETMULTCURSEL is called for multi-selection list boxes and combo boxes. The CtrlSetCursel function is only used for custom dialogs.

parameter:

SZDialogname

Specifies the name of a valid custom dialog that contains the controls to be found.

NControlid

Specifies the resource ID of the control containing the lookup string.

Sztext

Specify a string lookup. If the string is found, it is selected (highlighted).

return value:

0: CtrlSetCursel successfully found and selected a specified string.

<0: CtrlSetCursel failed to find and selected a specified string.

6.13 CtrlSetFont

Syntax: CtrlSetFont (Szdialogname, HFont, NControl);

Description: The ctrlsetFont function specifies the font of a control in a custom dialog. This function is called in the DLG_Init routine in the dialog message processing loop. parameter:

SZDialogname

Specify the name of a valid dialog.

Hfont

Specifies a handler that has been created by calling getFont.

NControlid

Specify the resource ID of the control to be set to be set. In order to set the font to all controls in the dialog, the parameter is delivered to the predefined constant allControls.

return value:

0: CTRLSetFont successfully sets the required fonts in a dialog.

<0: CtrlSetFont failed to set the required fonts in a dialog.

6.14 CtrlSetList

Syntax: CtrlSetList (Szdialogname, NControlID, ListID);

Description: The CtrlSetList function puts the contents of a string list in the specified single or multi-selection list box or combo box control. Any original content is included in an item in the listID. InstallShield places each element in the string list into each element in the list box or in the combo box control.

parameter:

SZDialogname

Specifies the name of the dialog box that contains a list box or combo box.

NControlid

Specify the resource ID of the list box or combo box.

ListID

Specifies the name of a string list that contains elements to be copied to the list box or combo box control.

return value:

0: CtrlSetList successfully places the contents of the string into the control.

<0: CtrlSetList failed to place the contents of the string into the control.

6.15 CtrlseTmletext

Syntax: CtrlseTmletext (Szdialogname, NControlID, ListID);

Description: The ctrlsetmleText function sets a text in multi-line editing box control. InstallShield puts each string in the ListID into the multi-line editing box control. This function is only used to customize the dialog.

parameter:

SZDialogname

Specify the name of a dialog.

NControlid

Specify the resource ID of the multi-line editing box control in a dialog.

ListID

Specifies the name of a valid string list that contains elements to be copied to multiplexed editing controls.

return value:

0: CtrlseTmleText Sets the text to the control.

<0: CtrlSetMletext Fails to set text in the control.

6.16 CtrlsetMultcursel

Syntax: CtrlSetMultcursel (Szdialogname, NControlID, Sztext, NSELECTFLAG);

Description: CtrlSetMultcursel function looks for the specified multi-selection list box or combo box control. If NSELECTFLAG is set to true, CtrlSetMultCurseel selected (highlighted) The item found. This function is only used to customize the dialog.

parameter:

SZDialogname

Specifies the name of a custom dialog.

NControlid

Specifies the resource ID of the multi-selected list box or a combination box control in the dialog.

Sztext

Specify a string lookup.

NSELECTFLAG

Indicates whether it is necessary to highlight it when CtrlSetMultcursl finds a project. One of the following predefined constants in this parameter location:

TRUE: Indicates that the project is to be highlighted.

FALSE: Indicates that the project is not displayed highlight.

return value:

0: CtrlSetMultcursel Found text in the control and displays it or does not highlight it according to the highlights indicated by NSELECTFLAG.

<0: CtrlSETMULTCURSEL failed to find text in the control. 6.17 CtrlState

Syntax: ctrlsetState (szdialogname, ncontrolid, nstate);

Description: The CtrlStState function sets a check box or the current state of a check box or a radical button in a custom dialog. When you create a single and check box with a resource editor or dialog editor, you can set some of their features. If you encounter difficulties due to a button, check the feature of the control in the editor.

parameter:

SZDialogname

Specifies the name of a dialog that contains the check box or the radio button control.

NControlid

Specifies the resource ID of the check box or a radio button control.

NSTATE

Specifies the new state of the call torsion control. One of the following predefined constants in this parameter location:

Button_Checked: Setting the button to Checked.

Button_unchecked: Setting the button to unchecked.

return value:

0: CtrlSetState Successfully Set the status of the check box or a radio button control.

<0: CtrlStState failed to set the status of the control.

6.18 CtrlSettext

Grammar: CtrlSettext (Szdialogname, NControlID, Sztext);

Description: The CtrlSetText function sets a custom dialog box for a single line editing area, a static text area, or a call button. To set the text in the multi-line editing area, call CtrlSetmleText.

parameter:

SZDialogname

Specify the name of a dialog.

NControlid

Specify the text of the text to be set to be set by the resource ID of the single-line editing area, a static text area, or a button control.

Sztext

Specify the text placed in the control.

return value:

0: CtrlSetText Successfully Sets the text in the control.

<0: CtrlSettext Fails to set the text in the control.

6.19 Definedialog

Syntax: Definedialog (szdialogname, hinstance, szdllname, ndialogid, szdialogid,

NRESERVED, HWNDOWNER, LMSGLEVEL;

Description: The definedialog function defines a custom dialog. When you need to specify a property that its property cannot be specified by the dialog specified by EZDefinedialog, call the function instead of ezdefinedialog. Note Definedialog does not display a custom dialog. To display a custom dialog, you must call Waitondialog.

parameter:

SZDialogname

Specify the name of the custom dialog you want to define. This name identifies the dialog and uses in all subsequent calls to the custom dialog function. The name of the dialog is case-sensitive, you must use it in the same way as you specify in this parameter.

Hinstance

Specifies the instance handle of the DLL where the dialog resides. If you specify a full qualification of the DLL in szdllname, you can specify this parameter to 0. To get a DLL's instance handle, call Microsoft Windows API LoadLibrary.

Szdllname

Specifies the full qualification of the DLL file containing the dialog resource. If you don't specify a path, INSTALLSHIELD finds the DLL in the Windows folder. If you don't find there, InstallShield looks up the folder specified in the Find path. If you specify a DLL instance handle with the parameter hinstance, you can deliver an empty string for this parameter. When the dialog is located _ISUSER.DLL, you can specify an empty string for this parameter. If this parameter is specified as an empty string, InstallShield will automatically detect _isuser.dll. NDialogid

This parameter specifies the resource ID when you use a number (instead of a string) to identify the dialog box. This parameter is used only when SZDialogID is an empty string. This parameter is recommended instead of SZDialogID to identify dialog resources.

Szdialogid

This parameter specifies the resource ID when you use a string (instead of a number) to identify the dialog resource. If this parameter is an empty string, NDialogID is used to identify dialog resources. It is highly proposed to use NDialogID instead of SZDialogID to identify dialog resources.

NRESERVED

Transfer 0 to this parameter. Other values ​​are not allowed.

HWndowner

Specifies the window handle of the main window. Specify this parameter as hwnd_install to make the InstallShield main installation window becomes the main window of the dialog.

LMSGLEVEL

This parameter specifies which window messages to be sent to the dialog. You must use or operate to combine one of the following constants and constants DLG_CENTERED:

DLG_MSG_Standard: Filter most Windows messages; only those direct and dialog controls are passed to the dialog box.

DLG_MSG_all: Pass most of Windows messages.

return value:

0: Definedialog Success Definition Dialog.

DLG_ERR_ALREADY_EXISTS (-3): You are trying to define a dialog that has been defined by Definedialog. You cannot define two dialogs with the same name.

DLG_ERR (-1): Indicates an undetermined error.

6.20 enddialog

Syntax: enddialog (szdialogname);

Description: The EndDialog function closes a custom dialog. It deletes the dialog and launches the dialog closing process. When any of the following cases, use enddialog:

The next button or its equivalent has been processed.

CANCEL twisting or its equivalent has been processed.

The Close system menu option has been selected (this behavior sends a DLG_Close message).

Any other case of the user ends the dialog operation.

parameter:

SZDialogname

Specifies the name of the dialog to close.

return value:

0: Enddialog successfully closed the dialog.

<0: EndDialog Failed to close the dialog.

annotation:

• When calling EndDialog Close a custom dialog, call the ReleaseDialog function to release the memory associated with the custom dialog.

· As long as you haven't called ReleaseDialog to remove the dialog from memory, you can reset a custom dialog that has been closed by calling EndDialog by calling Waitondialog. Note, however, if you call Waitondialog to open a dialog that has been opened and closed in your script, you must call CMDGETHWNDDLG again to get a new handle. The old handle is no longer effective.

6.21 ezdefinedialog

Syntax: ezdefinedialog (szdialogname, szdllname, szdialogid, ndialogid);

Description: The ezdefinedialog function defines a custom dialog. Note that EZDefinedialog does not display a custom dialog. To display a custom dialog, you must call Waitondialog. parameter:

SZDialogname

Specifies the name associated with the dialog specified by SZDialogID or NDialogID. To process the dialog, use this name in the reputation of the custom dialog function. Note that the name of the dialog is case sensitive, you must use it fully as specified in this parameter.

Szdllname

Specifies the full qualification of the DLL file containing the dialog resource. If you don't specify a path, INSTALLSHIELD finds the DLL in the Windows folder. If you don't find there, InstallShield looks up the folder specified in the Find path. If you specify a DLL instance handle with the parameter hinstance, you can deliver an empty string for this parameter. When the dialog is located _ISUSER.DLL, you can specify an empty string for this parameter. If this parameter is specified as an empty string, InstallShield will automatically detect _isuser.dll.

Szdialogid

This parameter specifies the resource ID when you use a string (instead of a number) to identify the dialog resource. If this parameter is an empty string, NDialogID is used to identify dialog resources. It is highly proposed to use NDialogID instead of SZDialogID to identify dialog resources.

NDialogid

This parameter specifies the resource ID when you use a number (instead of a string) to identify the dialog box. This parameter is used only when SZDialogID is an empty string. This parameter is recommended instead of SZDialogID to identify dialog resources.

return value:

0: EZDefinedialog Success Definition Dialog.

DLG_ERR_ALREADY_EXISTS (-3): You are trying to define a dialog that has been defined by the EZDefinedialog. You cannot define two dialogs with the same name.

DLG_ERR (-1): Indicates an undetermined error.

6.22 GetFont

Grammar: getFont (SzfontName, NpointSize, Nattributes);

Description: The getFont function creates a font and retrieves its handle, you can use the font handle to specify the fonts used in the control in a custom dialog.

parameter:

SZFontName

Specify the name of the font you want to build.

Npointsize

Specify the number of points you want to build.

Nattributes

Specify font styles. One of the following predefined constants in this parameter location is passed. You can use a bit or operator (|) to specify a variety of styles:

Style_Bold: Specifies a bold style.

STYLE_ITALIC: Specifies the slope.

Style_normal: Specifies a normal system font.

Style_underline: Specifies the character to be completed.

return value:

XXXX: XXXX is the handle of the font.

0: GetFont failed to establish the required font.

annotation:

· When installing is abort, INSTALLSHIELD will delete fonts created by the function. In addition, when it is aborted, INSTALLSHIELD releases all system resources.

6.23 HiWord

Syntax: HiWord (LVALUE);

Description: The HiWord function is extracted from the 32-bit integer value specified by Lvalue (16 bits).

parameter:

Lvalue

Specifies the 32-bit integer to be taken from the distinction.

return value:

HiWord returns the high word (high 16 digits) of Lvalue. annotation:

· INSTALLSHIELD's HiWord differs from the corresponding C's macro because of symbolic extension. Therefore, if LValue is a negative number, the high byte of the value returned by HiWord is filled with 1. If necessary, you can generate a positive number and 0xFFFF bit and (and), as follows:

Lvalue = HiWord (LVALUE);

Lvalue = LVALUE & 0xFFF;

6.24 Loword

Syntax: loword (LVALUE);

Description: The loword function is quarantined from the 32-bit integer value specified by Lvalue, and returns the low word (low 16).

parameter:

Lvalue

Specifies the 32-bit integer to be taken from the lowest treatment.

return value:

This function returns the low word of the integer (low 16).

6.25 RELEASEDIALOG

Syntax: ReleaseDialog (Szdialogname);

Note: ReleaseDialog function releases all memory associated with the custom dialog identified by the SZDialogName. This function is called after calling EndDialog. This function is called outside the CASE statement of the message processing.

parameter:

SZDialogname

Specifies the name of the dialog to be eliminated.

return value:

0: Indicates all the memory associated with the function success release and dialog.

DLG_ERR (-1): The function failed. The dialog box may be invalid.

DLG_ERR_ENDDLG (-2): RELESEDIALOG is called before calling EndDialog. You must first call EndDialog to delete the dialog.

6.26 SDMAKENAME

Syntax: SDMAKENAME (SVSECTION, SZDLG, SZUNUSED, NVDLGNAME);

Description: The SDMAKENAME function creates a section name for a dialog. The section is used by writing or from a .iss file or from one .iss file, .iss file is used by InstallShield Silent.

parameter:

svsection

Specify the name. InstallShield uses variables szdlg and nvdlgname to set a value to the variable. This value is used by SilentReadData and SilentWriteData.

SZDLG

The name of the specified dialog is used to create a section name.

Szunused

This parameter is unused; the parameter is transmitted an empty string.

NVDLGNAME

Specify a counter that records the number of SDMAKENAMEs for the dialog specified for SZDLG. InstallShield automatically increments the counter. Use a unique variable name for each custom dialog. (Look at the following annotations)

return value:

no.

annotation:

• For the correct naming festival, you must use a unique variable name for each of the different custom dialogs in the fourth parameter. A simple way to do this is to name the variable using the SZDLG dialog box name. For example, when SZDLG is "MyDLGONE", the variable of the fourth parameter is nvmydlgone; when SZDLG is "MyDLGTWO", the name variable is NVMydlgtwo.

6.27 SilentReaddata

Syntax: SilentReadData (Szsection, Szvalname, NVAltype, svval, nvval);

Note: When a installation is running in a still mode (SILENT MODE) (when running setup.exe), the SilentReadData function indicates how the InstallShield Silent reads the .iss file dialog data for a custom dialog. Note You can create a .iss file by calling SilentWriteData. To use SilentReadData in your script, construct the logical structure thus it first detects to confirm that the installation is running in a stationary manner. Place the call of the SilentReadData function in the IF-ELSE statement of a test system variable Mode, as shown below:

IF (Mode = SilentMode) THEN

/ / Call SilentReadData here.

Else

/ / Call a normal, non-Silent function here.

Endif;

Custom dialogs can be used in your installation script that calls and processes resources (such as ezdefinedialog, and waitondialog), or is entirely external, as is performed as in calling the function in the DLL. Another situation is that you must use SilentReadData to retrieve the return value of the dialog button from the .iss file (Next, Back, Cancel, etc.) and the value set or returned in the variable.

parameter:

Szsection

Specify the name of the section of the dialog data in the .iss file. Do not include square brackets ([]). The format of the parameter szsection is - , is the dialog function name used in the script, is the number of times the dialog box in the script, starting from 0. For example, the first appearance of the MyDialog function dialog will have a szsection value "MyDialog-0", and the second appearance is "MyDialog-1", the third time "MyDialog-2", so continues.

Szvalname

Specifies the value name in the section of the dialog data that appears in the .iss file. Each dialog has at least one value to the SzvalName, and identifies the value returned by the dialog box by twisting control (back, next, or ok, or cancel). Other value names are used to identify values ​​and data associated with other dialog controls.

NvalType

Identify the data type of the value that assigns a value name in SzvalName. The value itself is saved in SVVAL or NVVAL, depending on the value of NVALTYPE. One of the following predefined constants in this parameter location:

Data_String: The value of the value name in the SzvalName is a String type. Its value will be saved in SvValue.

Data_Number: The value of the value name that assigns to SzvalName is Number type. Its value will be saved in NVValue.

Data_component: The value assigned to the value name in SzvalName is a component name. Its value will be saved in SvValue.

Data_List: The value assigned to the value name in SzvalName is a list ID of an installshield list. Its value will be saved in NVValue.

Svval

Specifies the value of the value name in SzvalName when NVALTYPE is Data_String or Data_Component.

NVVal

Specifies the value of the value name in the szvalname when NVALTYPE is DATA_NUMBER or DATA_LIST.

return value:

0: SILENTREADDATA Successfully Indicates How INSTALLSHIELD SILENT reads the dialog data for the Custom Dialog.

<0: SilentReadData Fails to indicate how installShield Silent reads the dialog data for the Custom Dialog. annotation:

SiLentReadData will fail with the following cases (the return value is less than 0):

The .iss file is not found.

The dialog box in the script is not completely matched with the dialog box specified in the .iss file.

The specified dialog data section is not found in the .iss file.

The specified keyword name is not found in the specified dialog data section.

Data types assigned to the specified keyword name and the mismatch specified in the SilentReadData call.

6.28 SilentWriteData

Syntax: SilentWriteData (Szsection, Szvalname, NVALTYPE, SZVAL, NVAL);

Description: The selection made in the custom dialog box during the SilentWriteData function record. This selection data is written to a .iss file for installshield Silent. To write a .iss file during a installation process, run Setup.exe with the -R switch.

Custom dialogs can be used in your installation script that calls and processes resources (such as ezdefinedialog, and waitondialog), or is entirely external, as is performed as in calling the function in the DLL. Another situation is that you must use SilentReadData to retrieve the return value of the dialog button from the .iss file (Next, Back, Cancel, etc.) and the value set or returned in the variable.

parameter:

The same as the SilentReadData function.

return value:

0: SilentReadData Successfully Write the Dialog Box Data to Setup.iss.

<0: SilentReadData is not able to write a dialog data to the dialog box to Setup.iss.

6.29 WAITONDIALOGOG

Syntax: Waitondialog (szdlgname);

Note: The wait3og function displays a custom dialog. Your script can process different responses to the user according to the return value of the function.

parameter:

szdlgname

Specifies the ID of the dialog to display.

return value:

Dialog Control ID: The ID of the dialog control for the WM_COMMAND message is received.

DLG_Close (-200): This message will be a signal that will be turned off as a dialog.

DLG_ERR (-1): This message is received if any errors occur.

DLG_INIT (-100): The message is received before the dialog is to be displayed.

转载请注明原文地址:https://www.9cbs.com/read-30521.html

New Post(0)