Mimer SQL Documentation TOC PREV NEXT INDEX

Mimer SQL Developer Site


Creating the Installation Package


This chapter describes the steps necessary to bundle the Mimer SQL relational database management system with an application. This enables you, as an application developer, to install both your application and Mimer SQL with one integrated installation script.

2.1 Methods for Creating a Silent Mimer SQL Installation

The first step when creating an installation package is to create a silent installation of Mimer SQL. This installation will, in the integrated solution, be activated by your application's installation program.

There are two ways of creating a silent Mimer SQL installation:

2.2 Creating a Silent Mimer SQL Installation with InstallShield

Start by obtaining a distribution of Mimer SQL. It can be downloaded from
http://developer.mimer.com/downloads.

Note: The distribution can be either a full distribution, containing both client and server functionality, or just a client distribution.

The Mimer SQL version 9.3 installation uses the InstallShield 2008 installation program. You can find more information about InstallShield at their web site
http://www.installshield.com.

2.2.1 The Mimer Installation Files

An installation package is based on the Mimer SQL distribution files.

The program setup.exe performs the Mimer SQL installation.

The installation package should contain copies of the following files and directories (including contents) from the CD distribution:

 program files (directory)
 System32 (directory)
 0x0409.ini
 Autorun.inf
 instmsiw.exe
 ISSetup.dll
 Mimer SQL Engine.msi
 setup.exe
 Setup.ini
 WindowsInstaller-KB893803-x86.exe
 
Note: You may not copy the defkey9x.mcfg or defkeynt.mcfg files.

2.2.2 Creating a Response File

A Mimer response file contains information about installation options. To create a response file, you must run the Mimer SQL setup.exe using the -r option.

To create the response file:
  1. Locate setup.exe on the Mimer SQL distribution.
  2. Run setup.exe with option -r, for example:
 setup -r -f1"C:\My App\mimresp.iss"

The option -r causes some changes in the setup dialog box. The modified dialog box allows the same response file to be used both to install and to reinstall Mimer SQL. That is, running a silent setup will implicitly remove an older version of Mimer SQL when necessary. For information on the -f1 option, see Switches.

The choices you make while installing are recorded in the response file In the example above, the response file is placed in the directory C:\My App.

2.2.3 Including Mimer SQL in Your Installation Script

In your installation script, you must specify the Mimer SQL setup and the response file you want to use.

To add the information:

Run the following command:

 setup -c"C:\My App\mimresp.log" -s
       -f1"C:\My App\mimresp.iss" -f2"C:\My App\mimresp.log"
 

Note that in the example above:

 -c"C:\My App\mimresp.log"
 

is the Mimer SQL specific switch which specifies the location and name of a reboot indicator log file and inserts a RebootNeeded line in the file.

 -f2"C:\My App\mimresp.log"
 

specifies the location and name of the log file created by InstallShield Silent.

We recommend that the reboot indicator log file and the log file are the same file.

For more information on switches, see Switches.

2.2.3.1 Example Output

The following text is an example of the output in mimresp.log after the command above:

 [ResponseResult]
 ResultCode=0
 RebootNeeded=0
 

ResultCode=0 indicates that the installation was successful. The setup runtime error codes are further described in setup.exe.

RebootNeeded=0 indicates that it was not necessary to reboot after this installation.

If RebootNeeded=1 had been returned, it would indicate that a reboot of Windows had been necessary in order to complete the Mimer SQL installation.

See InstallShield Information for more information on the options for creating the silent install file and invoking the silent setup.

In error situations there may be an entry ErrorText=... in the log file that provides additional information about the cause of the failure.

2.3 Creating a Mimer ODBC Stand-alone Installation Package

The Mimer ODBC stand-alone installation package is an alternative to the Mimer SQL client installation described above.

This method means that you write a Setup program that explicitly handles the Mimer ODBC components and calls a number of Microsoft ODBC functions for installing, uninstalling and upgrading.

The Mimer ODBC stand-alone installation has the following characteristics:

When you choose this method, you should consider the following:

2.3.1 Including the Mimer ODBC Components

In your Setup program, you must include the following Mimer ODBC components:

You obtain these components by running a typical Mimer SQL installation and then copying the components from the directory in which you installed Mimer SQL.

In your Setup program, you install the components by using calls to SQLInstallDriverEx and SQLConfigDriver.

SQLInstallDriverEx adds information about the driver to the ODBCINST.INI entry in the system information and increments the driver's UsageCount by 1.

SQLConfigDriver completes the Mimer SQL installation by performing Mimer SQL specific functions such as update of Mimer SQL specific system information.

The arguments of these functions are further described in ODBC Supplementary Information.

2.3.1.1 ODBC Stand-alone Installation Example

The following C example will perform an ODBC stand-alone installation:

 rc = SQLInstallDriverEx(
        "MIMER\0Driver=Mimodbcw.dll\0Setup=Mimsetw.dll\0"
        "SQLLevel=1\0"
        "FileUsage=0\0"
        "DriverODBCVer=03.51\0"
        "ConnectFunctions=YYY\0"
        "APILevel=2\0"
        "CPTimeout=60\0\0",
        "C:\\Program Files\\MIMER93",
        pathout,
        255,
        NULL,
        ODBC_INSTALL_COMPLETE,
        &ucount);
 if  (!rc) {
     rc = SQLInstallerError(1,&errcod,errtxt,1000,&errlen);
     printf("Error: %s\n",errtxt);
 }
 rc = SQLConfigDriver(NULL,ODBC_INSTALL_DRIVER,"MIMER",
        NULL,pathout,255,&meslen);
 if  (!rc) {
     rc = SQLInstallerError(1,&errcod,errtxt,1000,&errlen);
     printf("Error: %s\n",errtxt);
 }

2.3.2 Removing the Mimer ODBC Components

You remove the Mimer ODBC components by using calls to SQLRemoveDriver and SQLConfigDriver.

SQLRemoveDriver deletes information about the driver from the ODBCINST.INI entry in the system information and decrements the driver's UsageCount by 1.

SQLConfigDriver completes the removal of the components by performing Mimer SQL specific functions such as updating Mimer SQL specific system information.

The arguments to these functions are further described in ODBC Supplementary Information.

2.3.2.1 ODBC Stand-alone Removal Example

The following C example will remove Mimer ODBC components:

 rc = SQLConfigDriver(NULL,ODBC_REMOVE_DRIVER,"MIMER",NULL,
        pathout,255,&meslen);
 if  (!rc) {
     rc = SQLInstallerError(1,&errcod,errtxt,1000,&errlen);
     printf("Error: %s\n",errtxt);
 }
 rc = SQLRemoveDriver("MIMER",0,&ucount);
 if  (!rc) {
     rc = SQLInstallerError(1,&errcod,errtxt,1000,&errlen);
     printf("Error: %s\n",errtxt);
 }

2.3.3 External Dependencies

Note: You are responsible for installing a suitable .NET version of Microsoft ODBC and Microsoft libraries (Microsoft C run-time library and Common Controls) required by the Mimer ODBC driver.

Microsoft ODBC version 3.51 is recommended for a stand-alone installation of Mimer ODBC version 9.3.

The following Microsoft DLL's are also required:

File name
Version
Description
 msvcr80.dll
8.0.50727.762
Visual C++ .NET run-time library
 Comctl32.dll
5.80.2614.3600
Common Controls

Msvcrt.dll is the Microsoft C run-time library distributed with Visual Studio .NET 2005 SP1.

Comctl32.dll can be installed by executing 50comupd.exe which can be retrieved from Microsoft. The necessary files and instructions can be found at Microsoft's Download Center, http://www.microsoft.com/downloads/details.aspx?FamilyID=cb2cf3a2-8025-4e8f-8511-9b476a8d35d2&DisplayLang=en.

2.4 Adding a Mimer SQL License Key

Depending on your VAR license agreement with Mimer Information Technology, you may need to add a Mimer SQL license key to your installation script.

You use the ODBC routine SQLConfigDataSource to add the license key.

Note: Using the ODBC routine SQLConfigDataSource to add a license key can be compared to interactively adding a license key using the Mimer Administrator.

The following C example adds a Mimer SQL license key:

 rc = SQLConfigDataSource(NULL,ODBC_ADD_SYS_DSN,"MIMER",
      "InstallationNo=12345\0"
      "LicenseKey=23CB23B7C8D33E2F206A23CDEF67\0"
      "Description=This is my license key\0\0");
 

See Mimer Packaging Parameters and ODBC Supplementary Information for more information about SQLConfigDataSource.

2.5 Defining a Database

Once you have installed Mimer SQL and added a license key, the next step is to define and configure a database. The database can either be a local or a remote database. You can also associate the database with an ODBC data source name.

You use the ODBC routine SQLConfigDataSource to define and configure Mimer SQL databases and data sources from a program. The routine is documented in ODBC Supplementary Information and the Mimer specific parameters are documented in Mimer Packaging Parameters.

You use SQLConfigDataSource to perform the same tasks as you would normally perform using the Mimer Administrator. It is possible to override any defaults for parameters and, if you like, to invoke the same dialog boxes as the Mimer Administrator uses to enable the user of your application to perform customization for their specific environment.

2.5.1 Defining a Remote Database

The following sections document examples of how to define a remote database. For more examples, see Example Configuration Program. For more information on the parameters used, see Mimer Packaging Parameters.

If any parameters that are specific to a local or remote database definition are given, the system will create the appropriate database definition. In the examples below, the parameters NODE and PROTOCOL indicates that a remote database definition should be created.

2.5.1.1 Example 1

The following C example will create the definition for a remote database on the host db.mimer.com. The client will communicate using the TCP/IP protocol.

 rc = SQLConfigDataSource(NULL,ODBC_ADD_SYS_DSN,"MIMER",
      "DSN=MyRemoteODBC\0DATABASE=MyRemoteMIMER\0"
      "NODE=db.mimer.com\0"
      "PROTOCOL=tcp\0"
      "DESCRIPTION=This is my remote database\0\0");
 

The example above creates a new, system-wide, data source MyRemoteODBC and also a remote Mimer SQL definition for the database MyRemoteMIMER.

As the first (hwndParent) parameter is set to NULL, the operation is performed without displaying any dialog boxes.

2.5.1.2 Example 2

Alternately, you can achieve the same result as in example 1 with the following two calls:

 rc = SQLConfigDataSource(NULL,ODBC_ADD_SYS_DSN,"MIMER",
      "DSN=MyRemoteODBC\0DATABASE=MyRemoteMIMER\0"
      "DESCRIPTION=This is my remote database\0\0");
 

and

 rc = SQLConfigDataSource(NULL,ODBC_ADD_SYS_DSN,"MIMER",
      "DATABASE=MyRemoteMIMER\0"
      "NODE=db.mimer.com\0"
      "PROTOCOL=tcp\0"
      "DESCRIPTION=This is my remote database\0\0");

First, the data source is created and then, in a separate call, the remote Mimer SQL definition is created. This shows some important points regarding how SQLConfigDataSource is implemented.

When the input parameters are analyzed, the system decides which objects to work with. If a DSN parameter is specified, a data source is created.

Since the parameter is ODBC_ADD_SYS_DSN, this means that any existing definitions of MyRemoteODBC and MyRemoteMimer are overwritten.

If you want to change the NODE argument for an existing database definition the following call would do that:

 rc = SQLConfigDataSource(NULL,ODBC_CONFIG_SYS_DSN,"MIMER",
      "DATABASE=MyRemoteMIMER\0"
      "NODE=newnodename\0\0");

2.5.2 Defining and Configuring a Local Database

To create a local database, you specify one or more local parameters in a call to SQLConfigDataSource.

The following C program will create a local database definition with 1000 2K pages in the bufferpool.

 rc = SQLConfigDataSource(NULL,ODBC_ADD_SYS_DSN,"MIMER",
      "DATABASE=MyLocalMimer\0"
      "DIRECTORY=C:\DB6\0"
      "Pages2K=1000\0\0");
 

As the first argument (hwndParent) is set to NULL, the call will not display any dialog boxes.

DATABASE and DIRECTORY are required parameters that have to be specified when the first argument (hwndParent) is set to NULL.

The number of 2K pages will be set to 1000 and all other parameters will be set to their default values.

You can view the changes made by the installation program in the Registry Editor (regedit.exe) under the following keys:

 HKEY_LOCAL_MACHINE:
 Software\Mimer\Mimer SQL\SQLHosts\xxx
 Software\ODBC\ODBC.INI\yyy
 HKEY_CURRENT_USER:
 Software\ODBC\ODBC.INI\zzz
 

Where xxx is the database name, yyy is system data source name and zzz is user data source name.

2.5.3 Error Handling

Note that if the configuration is handled as a number of calls, then the error handling, from the installation program's point of view, can much more easily determine what went wrong.

In Example 1, it is possible that a data source was created even though the database definition was not. See I_InstError for more information on error handling.

2.6 Generating the System Databanks

When you have defined the database, you must generate the system databanks.

You can generate system databanks in your own program by calling SQLConfigDataSource with the SDBGEN command.

Consider the following example:

 rc = SQLConfigDataSource(hWnd,ODBC_CONFIG_SYS_DSN,"MIMER",
      "DATABASE=MyLocalMimer\0"
      "SDBGEN=-pSYSPSW MyLocalMimer 1000 \"\" 2000\0\0");
 

The above call will start a system databank generation for the database MyLocalMimer. The initial size for SYSDB will be 1000 and for TRANSDB it will be 2000 2K blocks.

Note that the default file name for TRANSDB is set using "", backslashes (\) are used as escape characters.

Whenever you use the -p option, the program is run in silent mode. In this mode no dialog boxes are displayed and any missing directories are created automatically.

If an error occurs, such as disk space exhausted, a dialog box is displayed where file names and/or sizes may be changed. However, in this case the fields for SYSADM password are disabled.

If you do not use option -p, the values specified will be used as the default values in the system databank generation dialog box.

When using the SDBGEN command with SQLConfigDataSource you should, for consistency, always specify -p when the hWndParent parameter is NULL. Otherwise, a dialog box is displayed even though you have requested SQLConfigDataSource not to do so.

If you want to use a command's default value, specify the default value using two double quotes (""). All commands except database-name are optional.

2.6.1 SDBGEN Parameters

The following example demonstrates all of SDBGEN's parameters:

 rc = SQLConfigDataSource(hWnd,ODBC_CONFIG_SYS_DSN,"MIMER",
      "DATABASE=MyLocalMimer\0"
      "SDBGEN=-pSYSPSW " /* SYSADM password      */
      "MyLocalMimer "    /* Database name        */
      "1000 "            /* Initial SYSDB size   */
      "\"\" "            /* TRANSDB file name    */
      "1000 "            /* Initial TRANSDB size */
      "\"\" "            /* LOGDB file name      */
      "1000 "            /* Initial LOGDB size   */
      "\"\" "            /* SQLDB file name      */
      "1000 ");          /* Initial SQLDB size   */
 

By using two double quotes ("") in the example above, SDBGEN will assign the default file names to the TRANSDB, LOGDB and SQLDB system databanks.

Note: We highly recommend that you let the SDBGEN program determine the appropriate location for the system databanks. SDBGEN does this by examining the available hard drives on the system and spreading the files over the disks and taking into account recovery and performance issues.

2.7 Starting the Database Server

By now you have installed Mimer SQL and, probably created a local database with associated system databanks. The next step is to start the local database server.

To start the server for the database MyLocalMimer use the following call:

 rc = SQLConfigDataSource(NULL,ODBC_CONFIG_SYS_DSN,"MIMER",
      "DATABASE=MyLocalMimer\0"
      "DbServer=START\0\0");

2.8 More Useful Examples

This section contains a few more useful example calls to SQLConfigDataSource. For more examples, see Example Configuration Program.

2.8.1 Example 1

This is the simplest possible call to create: a system data source, a Mimer SQL database and the system databank, and then start the database server:

 rc = SQLConfigDataSource(NULL,ODBC_ADD_SYS_DSN,"MIMER",
      "DSN=DB6\0"
      "DATABASE=DB6\0"
      "DIRECTORY=C:\DB6\0"
      "SDBGEN=-pSYSPSW DB6\0"
      "DBSERVER=START\0\0");

2.8.2 Example 2

The following call passes control to the user to perform all customization of a database.

The user may not change the data source name (as governed by the specification of SQLConfigDataSource), so the application knows how to connect to the database through the application defined data source name:

 rc = SQLConfigDataSource(hWnd,ODBC_ADD_SYS_DSN,"MIMER",
      "DSN=FIXEDDSN\0"
      "DATABASE=\0"
      "DIRECTORY=\0\0");
 

Please note that specifying an empty DIRECTORY allows SQLConfigDataSource to identify that a local database should be created.

2.8.3 Example 3

In this example, the database server is stopped and then the definition is deleted along with the data source definition.

 rc = SQLConfigDataSource(NULL,ODBC_REMOVE_SYS_DSN,"MIMER",
      "DSN=DB6\0"
      "DATABASE=DB6\0"
      "DBSERVER=STOP\0\0");

2.8.4 Example 4

This example demonstrates how to remove a Mimer SQL license key.

 rc = SQLConfigDataSource(NULL, ODBC_REMOVE_SYS_DSN,
      "MIMER",
      "InstallationNo=1234\0\0");

2.8.5 Example 5

This example demonstrates how to remove an ODBC data source.

 rc = SQLConfigDataSource(NULL, ODBC_REMOVE_SYS_DSN,
      "MIMER",
      "DSN=DB8\0\0");


Mimer
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
info@mimer.se
Mimer SQL Documentation TOC PREV NEXT INDEX