|Creating Custom Dialogs|
|Written by Administrator|
|Sunday, 07 June 2009 04:43|
Ghost Installer – Creating custom dialogs
This tutorial describes how to create custom-designed dialogs. You can create such dialogs using the Custom User Interface. This feature will makes your installation very flexible for the user.
The following situation is described in this tutorial:
1. Let us assume that we already have the created GI project file. If you have not done it yet, create a simple project. We need to create a new dialog in the Before Installation sequence.
2. We need to make some dependencies in the controls. We will use variables in this situation.
Click Installation Flow > User Interface. In the preference tree you can see installation sequences and dialogs. Main nodes are Installation, Uninstallation and Maintenance. All of them have Before, Progress, After and Finish nodes. Before node contains all dialogs that are shown before the process of installation. Progress node contains only one progress dialog. After node contains dialogs, that will be shown if the process has completed successfully, Finish node contains dialogs that will be shown after the process independently of its results. Below "Preference groups" window is "Dialog templates" window, which allows you to view, create and edit dialog templates. If you want to use any of the templates, simply drag it to the installation tree. We will create a dialog in "Before installation" sequence.
Press "New window" button to create a new dialog using "New dialog" window or drag a template to the installation tree. In this example we will use "Empty dialog - 2 Buttons - Next, Canel" template.
The next is to specify some parameters for that dialog. Enter the Dialog Identifier, the Dialog Name and the Dialog Caption. We have entered the dialog caption - [Dlg.UsersCompany.Caption]. We will define this string in the next steps. Press "Finish" at the end. Dialog is created!
Now we should create a new string in the language file. This string will be used for the caption of our created dialog. Let us pass to the Language Editor. Click Languages > Editor
Click Open language file button and choose the file as shown in the picture. Default folder for the languages files is ...Ethalone\Ghost Installer\Bin\lng
We have opened the file "English (United States).lng", and now we can proceed to the creating a language string.
1. Select "English (United States) in the group named as "CustomUI" plug-in. It allows you to edit languages strings for CUI plug-in.
2. Switch to the Strings tab in the Language properties pane.
3. Type the string name in the String properties pane. In this situation we are entering the name Dlg.UsersCompany.Caption.
4. Type the string value in the same pane. We are entering Enter your company name.
5. Save language file.
There is one more task - to make so that our dialogue could remember the name of user's company, which will be entered in the appropriate field. To do this we can use the Variables tool - it is most convenient here. Go to Advanced Features > Variables
1. Click Add variable button. So we are creating the normal variable.
2. Type the variable name in the tab field of the Variable properties.
Now we can proceed with CUI tool. Switch the window in the same way as it was done at the Step 1. The CUI tool is available, now select our dialog "User's Company name" in the sequence. The last aim is to see the result of our design.
1. To be able to see the strings from the English-language file we should switch the language, as shown in the picture.
2. To open the Dialog designer click the Edit dialog.
The Dialog Designer is opened. Now we need to create the editbox and the text label above it.
1. Click the button Edit. This tool lets you create editboxes.
2. Place an editbox in our dialog as shown in the picture. Do not forget about our created variable for this control - specify it in the Object Inspector, the property is "Linked Variable". Select "UsersCompany" from the list of available variables.
3. Click Text Label button. Now you can create a label.
4. Place a label in the dialog as shown in the picture. There is no a caption in the label yet. You should type it the Object Inspector in the appropriate field.
5. Click Preview button and make sure that all is done in the proper way.
Compatibility: Ghost Installer 4.0+
Available in: All editions
Article Keywords: Tutorials, Creating custom dialogs
|Last Updated on Friday, 26 March 2010 06:12|