INFO: ODBC Configuration Runtime NotesDocument ID: IR02044
The information in this article applies to:
- Setup Factory 6.0
This article describes how you can install ODBC on a userís system and configure ODBC drivers and Data Sources using Setup Factory 6.0.
The Setup Factory 6.0 ODBC configuration module will install the following files into your Setup Factory 6.0 directory:
...Setup Factory 6.0\InstallODBC.exe
...Setup Factory 6.0\ODBCConfig.ini
...Setup Factory 6.0\ODBCConfig.htm
Indigo Rose Corporation provides the InstallODBC.exe program for use free of charge in your Setup Factory 6.0 setups. When run, InstallODBC.exe will look for a configuration file named InstallODBC.ini that must be located in the same directory as InstallODBC.exe. InstallODBC.exe will read in the settings from the InstallODBC.ini file and then configure ODBC appropriately.
Note: InstallODBC.ini is simply ODBCConfig.ini renamed.
InstallODBC.ini is the configuration file that InstallODBC.exe needs in order to know "what to do". The commands stored in InstallODBC.ini will be interpreted by InstallODBC.exe, and the executable will pass the commands to certain functions in the ODBC DLL: odbccp32.dll.
For example the [Data Sources] section of the InstallODBC.ini file is used to configure ODBC data sources. InstallODBC.exe will read the information from this section and then pass it to "SQLConfigDataSource" function in odbccp32.dll.
When you want to use InstallODBC.exe you should make a copy of ODBCConfig.ini and rename it to InstallODBC.ini. ODBCConfig.ini must be located in the same directory as InstallODBC.exe, in order for InstallODBC.exe to function properly.
Note: In order to work properly both the executable and the INI file need to have the same name. For example if InstallODBC.exe was renamed to mark.exe and ODBCConfig.ini to mark.ini everything would function properly.
The InstallODBC.ini file has the following sections:
This section is for identification and information purposes only. You should never edit this section as the program will not run properly if it is changed.
This section allows you to specify the GUI settings for the InstallODBC.exe program. The Title= value lets you specify the text that will appear in the title bar of the InstallODBC.exe programís window. The LoadMessage= line allows you to specify the text that should appear in the actual window.
This section allows you to specify if the InstallODBC.exe program should configure the driver manager. The Install= value tells InstallODBC.exe whether or not it should install the driver manager. This option is usually not necessary because the MDAC install will do this for you. This command is equivalent to calling SQLInstallDriverManager from the installer DLL.
This section lets you specify ODBC drivers that should be configured. Please note that this does not install the driver files themselves but rather it configures the installed driver file. Most common ODBC drivers will be automatically installed and configured by the MDAC setup. The drivers that you specify here will be configured using the SQLInstallDriverEx function in odbccp32.dll. Please see the InstallODBC.ini fileís comments and examples for more details about using this section.
This section lets you specify ODBC data sources that should be configured. Please note that this does not install the database files themselves but rather it configures the data sources in ODBC for the databases. The data sources that you specify here will be configured using the SQLConfigDataSource function in odbccp32.dll. Please see the InstallODBC.ini fileís comments and examples for more details about using this section.
ODBCConfig.htm is this file. It is a general reference guide and description of the Setup Factory 6.0 ODBC configuration module.
Setup Factory 6.0 supports the installation of ODBC through the Microsoft Data Access Components (MDAC). Setup Factory 6.0 has built-in runtime support for MDAC 2.6. The Setup Factory 6.0 MDAC 2.6 runtime support module can be downloaded from: http://www.indigorose.com/setup/support/runtimes.html
Note: The Setup Factory 6.0 MDAC 2.6 runtime support module will force your user's system to reboot. If you decide to use the MDAC 2.6 runtime support module then you should use a Run on Reboot action to launch InstallODBC.exe.
Using InstallODBC.exe in Your Setup
Once you have configured the ODBCConfig.ini file and renamed it to InstallODBC.ini, add it and the InstallODBC.exe to your Setup Factory project. Set their destinations to be the same location. For the purpose of simplicity we will assume that InstallODBC.exe and InstallODBC.ini will be installed to: %AppDir%\Config for the remainder of this article.
Now we have to determine when we want to launch InstallODBC.exe. If your user's system needs to be rebooted (perhaps you are using Setup Factory's MDAC 2.6 runtime support module), we will use a Run on Reboot action to launch it. If the user does not need MDAC 2.6 installed on their system then we will simply use an Execute File action, on the Shutdown event.
What we will do in order to determine if our user's system will be rebooted is check the value of the %DoReboot% built-in variable. If %DoReboot% is equal to TRUE we will use a Run on Reboot action, and if %DoReboot% is equal to FALSE we will use an Execute File action. It is recommended that these actions be placed on the Shutdown tab of the Actions dialog.
The Run on Reboot action will look something like this:
File to Run: %AppDir%\InstallODBC.exe
Command line arguments:
The Execute File action will look something like this:
File to execute: %AppDir%\InstallODBC.exe
Command line arguments:
Working directory: %AppDir%
Run mode: Normal
Wait for program to finish running before continuing: Unchecked
Once you are finished the actions necessary to launch InstallODBC.exe, it will look something like this:
If (%DoReboot% = TRUE)
Run File on Reboot (%AppDir%\InstallODBC.exe)
If (%DoReboot% = FALSE)
The above actions will insure that InstallODBC.exe is executed properly; either right after the installation has completed or after the user's system has rebooted.
Note: Be sure to test your installation on a variety of operating systems and configurations to make sure that it functions properly.
For more information please see the following resources:
- Setup Factory 6.0 Runtime Support modules: http://www.indigorose.com/products/setup_factory_modules_1.php
- Microsoft's ODBC homepage: http://www.microsoft.com/data/odbc/default.htm
- MSDN ODBC Programmers reference: http://msdn.microsoft.com/library/en-us/odbc/htm/odbcabout_this_manual.asp
- Command Reference | Actions | Individual Actions | IF in the Setup Factory 6.0 help file
- Command Reference | Actions | Individual Actions | END IF in the Setup Factory 6.0 help file
- Command Reference | Actions | Individual Actions | Execute File in the Setup Factory 6.0 help file
- Command Reference | Actions | Individual Actions | Run on Reboot in the Setup Factory 6.0 help file
KEYWORDS: Setup Factory 6.0, ODBC
Last reviewed: October 30, 2002
Copyright © 2002 Indigo Rose Corporation. All rights reserved.