Reputation: 1
I have an install that creates several ODBC entries, one as a user DSN and one as a system DSN.
The install works fine on Windows XP. But when I do the install on 64 bit Windows 7 it installs the Registry entries in the wrong spot.
It should install the system entries in:
HKLM\Software\ODBC\ODBC.INI\Castit
but instead installs them in:
HKLM\Software\Wow6432Node\ODBC\ODBC.INI\Castit
If I create the ODBC entry manually and then check the registry, the entries are found in:
HKLM\Software\ODBC\ODBC.INI\Castit
I have even used the HKLM32 to try and force it to install it in the correct place. However if I use the HKLM64, then it puts them in the correct place on Win 7 and Win 8 but errors out installing on XP.
So question is: How do I specify an ODBC entry that will work on both XP and Win 8 and hopefully everything in between.
Upvotes: 0
Views: 1399
Reputation: 5472
On 64bit systems there are 2 registry views: "32bit" and "64bit".
32bit systems of course have only "32bit" view.
HKLM\Software on 32bit systems equals HKLM\Software\Wow6432Node view on 64bit system.
So your keys are correct because by default Inno Setup is set to use 32bit view even on 64bit systems.
For multiple Windows you can check whether it is 64bit:
if IsWin64 then
// Write 64bit registry keys
else
// Write 32bit registry keys
And use appropriate RootKey value: HKLM64 for 64bit keys and HKLM32 for 32bit keys e.g. :
RegWriteStringValue(HKLM64, 'Software\ODBC\ODBC.INI\Castit','Key', 'Value'));
Upvotes: 1