|Converting projects from 3.x to 4.x|
|Written by Administrator|
|Monday, 11 May 2009 09:48|
Ghost Installer 4.0 has a different project file format, than 3.x. Generally it is still an XML file, but many Ghost Installer has gone through many changes, so the configuration became different. All commercial versions of Ghost Installer have a built-in project converter, so old projects are converted when you simply open them. This article describes how the conversion works and gives a clue how to convert a project without any loss.
When you open an old project file, gDesigner asks if you want to convert a project to new format. Then it offers to choose, from which project template it should take User Interface configuration. This issue will be discussed later in this article, but usually the best option is to take the closest template to your installation, since, for example, special dialogs are shown for Web-Deploy plug-in or when a project is multi-featured.
First of all, the converter changes file extension from gi2 to gpr and converts the project tag. Then, due to new component structure in 4.0, goes a hard work of arranging files in components. Every file has a path, relative to component's base path, so the converter scans destination parameters of the files and arranges them in components, so, for example, all files that should be copied in %InstallPath% and its sub-folders go to one component while files designated for %System% to the other.
Components and files are created in the same feature, as original files if there are features in the source project. Components are also created in the same package as the original files. Components with the same path are created only if they are in different features or packages. So destination files structure remains unchanged, all files remain on their places, despite of a little more complex components structure.
After forming packages, components and features, the converter starts modifying the User Interface settings. As mentioned above, the converter requires a template to take the configuration from. In Ghost Installer 3.7 installation sequence only described the name of the standard dialogs, that will be shown during the installation. Ghost Installer 4.0 features Custom User Interface, so all dialogs and controls are described in the project. The converter places the whole user interface configuration part from the template. Then the converter reads the PreInstallDialogSequence parameter from StdUI configuration and determines, which dialogs are missing, and sets the Visible property of the missing dialogs to 0. Those dialogs are present in the installation sequence in design-time, but are not shown in run-time. You can make them visible by editing this dialog and setting its Visible property to 1.
Ghost Installer handles language strings differently now. Instead of defining languages list in %Languages% variable (in 3.x) Ghost Installer 4.0 has <languages> tag, that describes available languages and custom strings, languages are defined separately for each plug-in.
There are few things that converter doesn't take in account. The set of functions used in conditions has changed in Ghost Installer 4.0, so if you use functions in conditions, please refer to online help for list of available functions. For example, AskUser("Title", "Caption") should be replaced with MessageBox("Title", "Caption", 1, 1).
The plug-in mechanism has changed in Ghost Installer 4.0, so old third-party plug-ins wouldn't work and will be identified as Unknown plug-ins, they should be removed from the installation project.