Multi-featured project tutorial Print
Written by Administrator   
Monday, 11 May 2009 09:49

This tutorial describes how to make a multi-component Ghost Installer Project. Multi-component project is a project that contains several features, so the user is able to choose options that will be installed. Before creating multi-package projects please read Ghost Installer concepts page, for deeper understanding of the terms feature, component, etc.

In this tutorial we will build the project for the following situation:

1. The application is intended to work with cellular phones through a data-cable or an infrared port. Application has two major executables: one of them is a simple version, another is a version for advanced users.

2. There are several extensions: ScreenSaver Editor, RingTone Composer, Flash Backup, and Phone Simulator. Flash Backup extension can be installed for the advanced version only.

3. Additional options: RingTones Library, Wallpapers Library, ScreenSavers Library, Help files, Interactive Tutorials.

Step 1

So, the first step is starting gDesigner IDE. The dialog with project templates should appear. Choose Advanced template, as shown on the picture and press OK.

Step 2

Now we can go to "Project Settings" section and define some project settings. Here we define:
Application Name: CoolPhone Tuner
Application version: 1.2
Company Name: RND software group

Step 3

Now we have to create components for all program options that we have. To do that we move to Deployment > Components. What we have to do now is to create the following packages and components:

All components, except for the libraries should have %InstallPath% installation path. The libraries should have the corresponding path, for example RingTones library should have %InstallPath%\RingTones path.

Step 4

The components are created. Now it is time to create features. Go to Installation Flow > Features and create the features as shown on the picture below. The installation options tree in the Features dialog will be shown the same way you make the tree in this tool. Use New Feature button to add a new feature. New feature will be added to the selected branch, so to make the Extensions tree, for example, you have to first create the Extensions feature and then select this feature and press New Feature button. The description of the feature will be shown in the Features dialog during the installation process.

Step 5

The Features should now be linked to the proper components. For Example, Easy PhoneTuner feature should be linked to Easy PhoneTuner component and to Application files component. To link a feature to a component, select that feature and go to Components tab and check the required component's checkbox, as shown on the picture:

Step 6

Now when the packages are linked, we have to think about dependency. It is said in the task description that the Flash Backup extension works only with Advanced PhoneTuner. To make installation of Flash Backup without Advanced PhoneTuner impossible, we have to do the following: select Flash BackUp feature, go to Required Features Tag and check the Advanced PhoneTuner checkbox, as shown on the picture:

Step 7

Now you can proceed to adding files. Go to Deployment > Files, select the proper component, press Add Files button and select files to add.

In our Advanced PhoneTuner project, we have to add all files to corresponding components, i.e. Advanced.exe to Advanced PhoneTuner component, Easy.exe to Easy PhoneTuner component and so on.

After you've selected the files you want to add to current component, the Ghost Installer will prompt you which way you prefer the source path to be stored in the project. It doesn't matter, which way you will choose, they all point at the same location. After that the file dependency manager will appear and show which files are needed be the file(s) you've just added:

In this dialog all files that are needed for just added .exe or .dll are shown. You can select the destination of the dependent files. Usually the first option is alright (the selected files will be copied to Windows System directory), unless you know the exact position of the dependent file. This dialog can be called later by selecting Scan for dependency files from the context menu.

Step 8

The extensions we use for the PhoneTuner are the COM-servers, so they need to be registered. Select the dll, that should be registered and set Register server flag in Actions & flags tab.

Step 9

If you want your installation to contain Read Me and License Agreement dialogs, then place Readme.txt and License.txt (or .rtf) files in Presetup files folder. If you have read me and license files for different languages, make their extensions the same as their languages' IDs, for example License.ENU, License.ITA, etc. To do that, select Presetup files folder, press Add files button and find those files. Those files will be used later in Step 11.

Step 10

Now you can make shortcuts for the installed files. Go to Shortcuts tool and select the Advanced PhoneTuner component. Select %ProgramGroup% element in Current User tree, Press Add shortcut button, and the shortcut will be added. This shortcut needs a proper target, so press the button in the Object field and select the executable. Then change the Working Directory, make it the same as the executable's destination directory.

Step 11

Now you have to select what dialogs will be shown during the installation. Go to User Interface tool. In this tool you can define the sequence of the dialogs and edit the dialogs.

Before Installation sequence contains all dialogs, that are shown before the files are copied. Installation Progress Dialog contains the dialog, that is shown when the files are copied. After Installation sequence is shown after copying files if the installation was completed successfully. Finish Installation will be shown after the installation process if it failed, or after the After Installation sequence. Selecting a dialog in a sequence will cause a dialog preview. Drag the dialogs to form the desired installation and uninstallation sequences. As soon as we want our customers to select the installed options, we have to add the Features Dialog before Installation Directory Dialog.

Step 12

If you have chosen to show License or Read Me dialogs (or both) you have to specify the files for those dialogs. If you have read me and license files for different languages, make their extensions the same as their languages' IDs, for example License.ENU, License.ITA, etc. Then select License Dialog in the Before Installation sequence. Select Quick Properties tab below, select License File property and type %presetup%\license.%LangID% as shown on the picture below. If you have a single file for all languages, then type the name of that file, for example %presetup%\license.txt. The same actions should be performed for ReadMe dialog.

Step 13

The Project is ready! The last thing left is to build the project. To build a project, press Build Project button or F7 key. Then press Build button and wait for the project to be built.

Congratulations!!! The project is built. Now you can press Browse button to move to the folder where Setup.exe was created, or you can press Run button to see how the installation works. Don't forget to save your project after you close the dialog.