How to register ODBC driver?

connector, database, odbc, sqlite

Solution

What I would recommend for you is to create a bootstrapper installation package. You didn't mention the platform you are delivering for, but since you are writing about installers I will assume that the platform is Windows.

There are multiple installer frameworks you can use to create installers for your software on Windows, but the one I recently used and would recommend is WixToolset. They have some documentation on how to build bootstrapper bundles here

In great simplicity my wix bootstrapper came down to installing one exe installer and one msi installer and the configuration looked something like this (in great simplicity - the link I provided has full documentation on how to configure all the features)

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"       xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
   <Bundle Version="..." Name="...">
        <Chain>
            <ExePackage Id = "x86redist" SourceFile="..." ... />
            <MsiPackage Id = "myApp" SourceFile ="..." ... />
        </Chain>
  </Bundle>
</Wix>

in the end after building, my bootstrapper bundle looked like this

and made sure both my software and the redistributable package were installed on the machine when it was finished.

You could use exactly the same approach - the bundle could install the odbc driver using its original installer, and then install your software.

Problem

I have created a inventory system for my school project and I use SqlLite as standalone DB. I am able to run it as long as I install the SqlLite ODBC connection (separate installer). But what I want is to create an installer and install the SqlLite ODBC Drivers along with my porject in one installer instead of of running two separate installer (my application and sqlLite ODBC driver installer). Any idea how to do it? Or do you have any recommendation? What I have done so far. I copy the SQLLite ODBC dll into my application folder and run it but an error shows telling that no ODBC driver installed. I failed to register the SqlLite odbc dll on both 32 and 64 bit windows OS.

Original source