In some cases it can be useful to have different copies ofsame versions of CSDK installed in the same machine, though this is not anofficially recommended approach by IBM technical support. This documentidentifies the most common problems when using different copies of same version
sof CSDK on the same machine and how to solve them. The first problem you willencounter if you try to install another copy of the same version of CSDK iswith the Windows Installer. By design, the Windows Installer detects if youhave a pre-existing installation of CSDK and it gives you the options ofModify, Repair or Remove.
Windows keeps a database of products installed on themachine. Every time you install a product using the Windows Installer a new keyis added to the registry with specific information about the product, installmedia location and options used for the install.
This is the database used when you run the “Add or RemovePrograms” applet from the “Control Panel”
When you launch the install process for a product, WindowsInstaller checks if there is already an entry in the Uninstall registry keywith the same id, if so it assumes that the product is already installed andlaunches the installer in Maintenance mode (with options Modify, Repair andRemove).
Different major versions of CSDK have unique productid’s, this means you can easily install CSDK 2.90.TC1 and CSDK 3.00.TC1, but ifyou try to install two releases of the same minor version (e.g.:3.00.TC1 and 3.00.TC3) the installer would not allow it. Currently the Windowsinstaller does support single installation of various CSDK versions indifferent locations on the same host.
To overcome this design restriction, you can use a Microsofttool like Windows Installer CleanUp to remove theRegistry entry corresponding to the version. Note that this will not uninstallthe binaries; it would only remove the entry from the Uninstall database. Thismay allow us to reinstall the product.
Due to these shortcomings sometimes there can be a need tobypass the Informix Client SDK or I-Connect installation process and copy theInformix library and API files directly to a machine. Though the officiallyrecommended and supported approach is to use the supplied CSDK/I-Connectinstaller, these instructions are provided as an alternative approach involvingcopying files for scenarios where using the installer is not possible.
CSDK 3.x is a bundle containing the followingapplication-programming interfaces:
IBM Informix Object Interface for C++
IBM Informix ESQL/C
IBM Informix ODBC Driver
IBM Informix OLE DB Provider
IBM Informix .NET Provider
LIBMI Client API
While some of these components can easily be used andredistributed without the complete CSDK bundle, there are some other componentswhich are more challenging to redistribute due to the way they interact withthe Windows operating system. APIs such as the ODBC driver and the OLE DBprovider depend on additional CSDK libraries to work. These libraries must beaccessible to your application.
In most cases, Windows searches in the directories includedin the PATH variable to load these libraries. One of the main problems whensupporting multiple versions of CSDK is mixing libraries between versions(e.g.: .NET provider from a newer version loading the ODBC library from an oldversion). In the same way as Windows uses the PATH variable to search for DLLs,Informix components use the INFORMIXDIR directory to load additional resourcessuch as GLS conversion files or message files.
The primary rule when using multiple versions is to have theINFORMIXDIR and PATH environment variables pointed to the directory containingthe version you want to use. You can accomplish this creating a batch file(e.g.: .BAT or .CMD file) to start your application or running the applicationas a user which has different environment settings.
Here is an example:
- - test.cmd - - - -
- - - test.cmd- - - -
Interface for C++, ESQL/C and LIBMI
If you want to use the Object Interface for C++, ESQL/C orLIBMI you can follow the steps in following IDS Experts article: Redistributing IBM Informix Client products.
You will need to ensure that both the PATH and INFORMIXDIRvariables are pointing to the version of the CSDK installation folder you wantto use.
Using different versions of the IBM Informix ODBC driver canbe more complex. Any ODBC driver on a Windows machine must have a unique name.In the case of CSDK 3.50 and 3.00 the name for the ODBC driver is “IBM INFORMIXODBC DRIVER”. Windows keeps the list of installed drivers in the ODBCINST.INIregistry key.
Note that in previous versions of the CSDK package the namefor the ODBC driver was different (e.g.: IBM INFORMIX 3.82 32 BIT).
When you create a DSN using the ODBC Data SourceAdministrator tool (odbcad32.exe)
An entry is created in the registry with all the values usedin your DSN and the full path of the ODBC library used to create the DSN.
Windows uses the directory in the “Driver” registry key toload the ODBC library. You can use different versions of the ODBC driver bymanually changing the directory in the “Driver” key.
Even if you can update this key from the console or a shellscript before your application starts, the best approach is having a differentDSN depending on the driver you want to use, or use a relative path (e.g.:“.\iclit09b.dll”) and only rely on the Windows DLL loader mechanism.
The ODBC Data Source Administrator tool always loads theODBC library specified in the “ODBCINST.INI\%DRIVERNAME%\Setup” key, even if the DSN entry you are modifying has a differentpath in the “Driver” key.
For other APIs, the values for the variables PATH andINFORMIXDIR need to be changed depending of which DSN you want to use.
OLE DB Provider
The OLE DB provider library is called Ifxoledbc.dll. Windowsuniquely identifies an OLE DB provider based on the Class id (CLSID) and theprovider name (e.g.: Ifxoledbc). In the CSDK install process the OLE DBprovider is automatically registered in the Windows registry. At any point youcan manually register a different version of the provider using theREGSVR32.EXE Microsoft tool.
This tool creates the needed keys in the Windows registry soyou can load the OLE DB provider using the “Ifxolebdc” name.
There are two places where the full path of the OLE DBlibrary is stored, one for the “Ifxoledbc” provider and a second for the “IfxoledbcErrorLookup”.
Note:the CLSID could change with different versions
The registry key that contains the path for the OLE DBlibrary is “InProcServer32”.
The best approach to use different versions of theIfxoledbc.dll library is to use a relative path rather than the full path…
Remember to update both keys with the desired value (Ifxoledbcand IfxoledbErrorLookup). When an application wants to load the “Ifxoledbc”provider, it would follow Windows operating system rules to search for thelibrary. You should point your PATH and INFORMIXDIR to the version you want touse.
Further information related to the DLL Search Order could befound in the following link.
Dynamic-Link Library Search Order
Windows has a central place for .NET assemblies called theGlobal Assembly Cache or GAC. During the CSDK install process the IBM Informix.NET Provider is installed in the GAC with the unique name (strong name) “IBM.Data.Informix”.
You can have multiple versions of the .NET Provider if theassembly version is different.
The assembly version for CSDK 2.81 and CSDK 2.90 is188.8.131.52, and for CSDK 3.00 and CSDK 3.50 the version is 184.108.40.206. (Note that220.127.116.11 and 18.104.22.168 correspond to the IBM Data Server Provider.)
The assembly version for the .NET provider in minor releases(e.g.: 3.00.TC1, 3.00.TC3, etc) is the same, which means that only one versionof the library could be registered in the global cache.
To be able to use more than one .NET provider, first youneed to uninstall the IBM.Data.Informix assembly from the GAC. To do this youcan use the “gacutil.exe” with the “/u” flag for uninstall, or use the Explorercontext menu…
When a .NET assembly is not in the global cache the .NETruntime would try to load the class from the same directory as the executable.(You can find more information about the assembly loading in the followinglink: How the Runtime Locates Assemblies.)
Copy the .NET Provider (IBM.Data.Informix.dll) to thedirectory where your application would start; this would allow you to usedifferent versions of the .NET provider.
Alternatively you can specify the location of the assemblyat runtime using the Assembly.LoadFile method and the AssemblyResolveevent. Further information on this topic can be found in the following MSDNlinks: Assembly.LoadFrom and AppDomain.AssemblyResolve
Before contacting IBM technical support
The officially recommended approach is to uninstall theprevious version of CSDK before installing the new one. If you need to rundifferent versions of any of the CSDK components on the same machine, youshould be aware of the potential issues.
Always check that the versions of the libraries loaded byyour application belong to the same CSDK versions. (You can use a tool likeTLIST.EXE from Microsoft to find which libraries your process is using) - Debugging Tools for Windows
Javier SagreraSnigdha Sahu