I've got a application that runs on a asa8 database. I'm using inno-setup to compile an install file. I am looking for sample inno-setup code to enter the ODBC entry in the registry. I have based my current logic from the below post.
Adaptive server anywhere ASA SqlAnywhere 8.0 ODBC driver
Currently I've got in the inno-setup file under the [registry] section:
[Registry]
;ASA DB drivers
Root: HKLM; Subkey: "SOFTWARE\ODBC\ODBCINST.INI\Adaptive Server Anywhere 8.0"; Flags: uninsdeletekeyifempty
Root: HKLM; Subkey: "SOFTWARE\ODBC\ODBCINST.INI\Adaptive Server Anywhere 8.0"; ValueType: string; ValueName: "Driver"; ValueData: "{app}\dbodbc8.dll"
Root: HKLM; Subkey: "SOFTWARE\ODBC\ODBCINST.INI\Adaptive Server Anywhere 8.0"; ValueType: string; ValueName: "Setup"; ValueData: "{app}\dbodbc8.dll"
Root: HKLM; Subkey: "SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers"; ValueType: string; ValueName: "Adaptive Server Anywhere 8.0"; ValueData: "Installed"
;ODBC entry
Root: HKLM; Subkey: "SOFTWARE\ODBC\ODBC.INI\LOADCON"; Flags: uninsdeletekeyifempty
Root: HKLM; Subkey: "SOFTWARE\ODBC\ODBC.INI\LOADCON"; ValueType: string; ValueName:
"AutoStop"; ValueData: "Yes"
Root: HKLM; Subkey: "SOFTWARE\ODBC\ODBC.INI\LOADCON"; ValueType: string; ValueName:
"DatabaseFile"; ValueData: "{app}\db_loadcon\loadcon.db"
Root: HKLM; Subkey: "SOFTWARE\ODBC\ODBC.INI\LOADCON"; ValueType: string; ValueName: "Driver"; ValueData: "{app}\dbodbc8.dll"
Root: HKLM; Subkey: "SOFTWARE\ODBC\ODBC.INI\LOADCON"; ValueType: string; ValueName: "Integrated"; ValueData: "NO"
Root: HKLM; Subkey: "SOFTWARE\ODBC\ODBC.INI\LOADCON"; ValueType: string; ValueName: "PWD"; ValueData: "sql"
Root: HKLM; Subkey: "SOFTWARE\ODBC\ODBC.INI\LOADCON"; ValueType: string; ValueName: "UID"; ValueData: "dba"
All this works fine (sort-off) in WINXP (32bit). It doesn't work in Win7 (64bit). Can someone show inno-setup code that will work for both 32 and 64bit OS. I am aware of the WOW6432Node in the registry and know that there is a 64 and a 32 bit ODBC Data Source Administrator in WIN7. I am aware that the 32bit ASA8 ODBC connection can only be made through the ODBCAD32.exe that is located in C:\Windows\SysWOW64\ folder. I have fiddled with inno-setup code but not being successful. I now need someone's expert opinion.
Also when I run the above inno-setup code on WINXP it creates a ODBC entry in the registry but does not show the entry in the actual ODBC Data Source Adminstrator GUI. However the ODBC connection works. Any idea on how to make the connection show in the GUI?
You need to make sure that the
LOADCON
entry is also listed underHKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources
in the registry in order for it to show in the GUI. (e.g."LOADCON" ="Adaptive Server Anywhere 8.0"
)As for the 32/64 issue, install the same keys to
\SOFTWARE\Wow6432Node\ODBC\ODBC.INI
and\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\ODBC Data Sources
(I would use copy/paste & modify the keys in the Inno file). The beauty of it is that if you install the 64-bit keys on a 32-bit system, they're just ignored.One way to see this is to manually create the ODBC entry on a 64-bit system. You'll need to run the 64-bit version of the ODBC Data Source Administrator (
odbcad32.exe
usually found inC:\Windows\SysWOW64
). Once you create the entry manually, have a look in the Registry in theHKLM\SOFTWARE\Wow6432Node\ODBC
section.