Building a Self-Installing Application
If you are developing an application to be provided as a complete user-installable package, you probably want to automate as much as possible of this. Ideally, you would like the user to need only to execute a single program to install both QM and the application software. This section describes two ways to do this.
Using a Commercial Installer Package
On Windows systems, we recommend use of the Astrum InstallWizard from Thraex Software (as used by QM itself) but the following process should map onto other self-installer packages.
Whatever installer package you use, it needs to install both QM and the application. The complication is that this process needs to run QM to create the account that will hold the application. The steps to achieve this are:
1.Unpack all the application files to wherever they need to go. The directory that will become the application account can be created during this process but the only QM specific subdirectory that should be created is the private catalogue (cat). You can place your own application install program into the cat subdirectory for later use. If you need to pre-load dictionary items or data file records, these should be unpacked into a temporary location.
2.The self-extracting file must also include the relevant version of QM as its own self-extracting file. This should be unpacked into a temporary directory.
3.Once everything has been unpacked, the process now needs to install QM by executing the QM self-extracting program. On Windows systems, use of the /silent command line option will suppress most user interaction.
4.Now that QM is installed (or upgraded), you need to use it to create the application account. The process should check whether the account already exists by looking for the VOC file and, if not, execute QM with a single command line option of
"CREATE.ACCOUNT account.name account.path NO.QUERY".
The quotes are required in this command and the working directory should be the QMSYS account. The CREATE.ACCOUNT command will not fail if the cat subdirectory already exists.
5.Next, you need to execute your own application installer program that should have been included in the contents of the unpacked private catalogue directory. This is done by executing QM with a command line option that is the catalogued item name and with a working directory of the newly created account.
6.Finally, you need to remove any temporary files.
So, what does the catalogued install program need to do?
•We recommend that it should start by executing a COMO command to create a log file of its progress.
•Create any application files that do not already exist.
•Copy dictionary items from a temporary set of dictionaries unpacked from the install file. By doing this rather than simply overwriting the dictionaries, anything that had been added will not be lost when updating an existing installation.
•Build any indices that are required.
•Create any application specific VOC entries such as paragraphs and sentences.
Using an Installation Script
The QM installer includes a mechanism that can be used to link it to installation of your own software. To use this, you distribute your software on a CD or as a downloadable zip file. This should contain all of your application software and the QM installation package together with a text file named qmcfg.dat and the qmsetup program described below. This program can be found in the bin subdirectory of the QMSYS account of your QM development installation and may be freely distributed.
To run the installation, the user executes the qmsetup program. This reads the qmcfg.dat file that contains data to control the installation process. There are two sections to this file which may appear in either order. Blank lines and lines commencing with a # character are ignored.
The [qm] section contains QM configuration parameters that will be updated in the qmconfig file by the installer. All QM configuration parameters except for the licence details may be updated in this way. Registered QM dealers can contact Ladybridge Systems for details of how to generate and apply QM licences automatically as part of the installation process.
The [application] section contains instructions to the qmsetup program. These are executed in the order in which they appear.
The EULA command identifies a simple text file that will be displayed to the user as the end user licence agreement. This must be approved by the user before the installer moves on.
The RUN command uses the operating system shell to execute the given command. In the example above, the first RUN command is used to execute the QM installer.
The COPY command copies a file or directory. The source and destination pathnames should be separated by a semicolon. Any spaces in the names are taken as being part of the name.
The CD command changes the current working directory. If no pathname is given, the directory holding the install script is assumed.
Any command may contain <mypath> which will be replaced with the pathname of the directory from which the installation was run. Thus
is equivalent to