Get Registry Key Value fails on 64 bit?
Is there any logical reason why a call to retrieve this key value:
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MUNISOFT\setup\SQLPath
works fine on 32 bit systems, but doesn't on 64 bit? I have manually verified that the key exists in the exact place that it is expected on 64 bit systems, the only difference is the actual text value in the key field.
On 64 bit systems, the value returned is always the default, and I'm not sure why?
1 Attachment(s)
Re: Get Registry Key Value fails on 64 bit?
Mark,
Some interesting reading (and demo) on how to how to handle 64-bit registry keys.
http://www.lindersoft.com/forums/sho...5620#post55620
You have to switch into 64-bit mode to access the 64-bit registry branch.
Friedrich
Re: Get Registry Key Value fails on 64 bit?
Would this also apply to Get Related Product calls?
Re: Get Registry Key Value fails on 64 bit?
I am afraid I don't understand the question, sorry.
Friedrich
Re: Get Registry Key Value fails on 64 bit?
BTW, the key you mentioned:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MUNISOFT\setup\SQLPath
is located in the 64-bit registry branch on x64 systems and so you have to switch into x64 mode to read/write it.
The same key as 32-bit looks like this on x64 systems:
HKEY_LOCAL_MACHINE\Software\WOW6432node\Microsoft\ Microsoft SQL Server\MUNISOFT\setup\SQLPath
Friedrich
Re: Get Registry Key Value fails on 64 bit?
Quote:
Originally Posted by
linder
BTW, the key you mentioned:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MUNISOFT\setup\SQLPath
is located in the 64-bit registry branch on x64 systems and so you have to switch into x64 mode to read/write it.
The same key as 32-bit looks like this on x64 systems:
HKEY_LOCAL_MACHINE\Software\WOW6432node\Microsoft\ Microsoft SQL Server\MUNISOFT\setup\SQLPath
Friedrich
Yes, except on the 64 bit machine the SQL server gets installed as a "legit" 64 bit app, so the registry is actually in the same place on a 64 bit machine (it does not) exist in the WOW6432node branch.
However, from your documentation I take it that the installer - as a 32 bit app - has its registry call automatically redirected to WOW6432node?
Re: Get Registry Key Value fails on 64 bit?
The Windows operating system handles this redirection completely behind-the-scenes.
32-bit keys are are stored in the following registry sub key on machines running a x64 OS:
HKEY_LOCAL_MACHINE\Software\WOW6432node
64-bit keys are are stored in the following registry sub key:
HKEY_LOCAL_MACHINE\Software
To access the 64-bit branch, you simply switch the installer into 64-bit mode and then you can access the native 64-bit resources. Don't forget to switch back to 32-bit mode after you have processed the 64-bit part.
Friedrich
1 Attachment(s)
Re: Get Registry Key Value fails on 64 bit?
Here is an example from one of the include scripts. It reads the 64-bit registry keys when running on a 64-bit OS.
Friedrich
Re: Get Registry Key Value fails on 64 bit?
Quote:
Originally Posted by
linder
The Windows operating system handles this redirection completely behind-the-scenes.
32-bit keys are are stored in the following registry sub key on machines running a x64 OS:
HKEY_LOCAL_MACHINE\Software\WOW6432node
64-bit keys are are stored in the following registry sub key:
HKEY_LOCAL_MACHINE\Software
To access the 64-bit branch, you simply switch the installer into 64-bit mode and then you can access the native 64-bit resources. Don't forget to switch back to 32-bit mode after you have processed the 64-bit part.
Friedrich
So even though the request is made for the exact correct registry path, Windows silently redirects the call to the WOW6432node branch because the SetupBuilder installation is a 32 bit app? Neat (but annoying).
Re: Get Registry Key Value fails on 64 bit?
Annoying? Why? It's not annoying at all. It's very very cool. You can access both 32-bit and 64-bit keys from the very same setup without any problem. So why do you think this powerful feature is "annoying"? This functionality is there for 9+ years now.
Friedrich