In the prototype file, dialog definitions consist of two main parts, the dialog section and the resource section. In the dialog section, the layout of the dialog is defined. The resource section stores all text strings used to present the dialog and assigns numbers to the texts. Only these text numbers are used in the dialog definition.
For the sample PIF product MERCHANT, we want to create a dialog to enter the installation directory. This dialog should be the first dialog being presented when the product MERCHANT is installed.
The definition of this dialog in the dialog section is as follows:
@DIALOG: #dhead: 600 , 400 , dlgInstallationDirectory , 1 ; #label: 1 , 1 , lblInstallDirectory , 2 ; #instdir: 1 , 2 , tfInstallationDirectory , $PATHmerchant ; #navbutton: 1 , btnInstall , 3 , 1 ; #navbutton: 2 , btnCancel , 4 , 0 ; @ENDDIALOG:
The width of the dialog is 600 pixels and the height is 400 pixels. The name of the dialog is dlgInstallationDirectory, and text number 1 in the resource section of the prototype file is displayed as the dialog heading.
Defines the label of the installation directory input field. The name of the label is lblInstallationDirectory and the text number 2 in the resource section is assigned. The position of the label in the virtual grid layered over the dialog is logical row 1, column 1.
Defines the installation directory input field. This field is presented in column 2 in the logical row 1. The value entered in the installation directory input field is assigned to the parameter $PATHmerchant.
Define buttons that allow navigating through the installation process.
Selecting the first button, btnInstall, installs the product. The text on the button is contained in text number 3 in the resource section. The action performed when the button is selected, is “Install the product” (1).
Selecting the second button, btnCancel, aborts the installation. The text on the button is contained in text number 4 in the resource section. The action performed when the button is selected, is “Abort the installation” (0).
The texts for this dialog in the resource section of the prototype file are as follows:
@RESOURCE: #locale: ENU ; #text: 1 , Select installation directory ; #text: 2 , Installation directory: ; #text: 3 , &Install ; #text: 4 , &Cancel ; @ENDRESOURCE:
Defines the language of the text strings, in this case, ENU defines English (U.S.). (Refer to the description of the language identifiers).
Define the text numbers used in the dialog definition. For example, the text "Select installation directory" is assigned the text number 1, which is used to define the dialog heading in the dialog section of the prototype file.
The ampersands characters (&) in the text strings number 3 and 4 determine that the capital letters I and C) are used as shortcuts for the Install and Cancel actions.
To specify that the Select installation directory dialog is the first dialog presented when installing the product MERCHANT, use the keyword #dlgpreinit in the product information section in the prototype file, as follows:
@PRODUCT: #phead: MERCHANT , 2.1.0.0 ; #sys: Any ; #locale: ENU ; #comment: This is an example for a PIF product ; #ppath: $PATHmerchant ; #pdep: Ingres , 4.0.0.0 , >= ; #postinit: bin/create_tables.sh ; #dlgpreinit: dlgInstallationDirectory ; @ENDPROD:
Specifies that the dialog with the name dlgInstallationDirectory appears as the first installation dialog.
The command line interface and the Packager GUI add the installation dialog automatically to the PIF product. No actions are necessary.
|
Copyright © 2014 CA Technologies.
All rights reserved.
|
|