+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Get Registry Key Value fails on 64 bit?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default 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?

  2. #2
    Join Date
    Mar 2004
    Posts
    4,307

    Default 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
    Attached Images Attached Images  

  3. #3

    Default Re: Get Registry Key Value fails on 64 bit?

    Would this also apply to Get Related Product calls?

  4. #4
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Get Registry Key Value fails on 64 bit?

    I am afraid I don't understand the question, sorry.

    Friedrich

  5. #5
    Join Date
    Mar 2004
    Posts
    4,307

    Default 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

  6. #6

    Default Re: Get Registry Key Value fails on 64 bit?

    Quote Originally Posted by linder View Post
    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?

  7. #7
    Join Date
    Mar 2004
    Posts
    4,307

    Default 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

  8. #8
    Join Date
    Mar 2004
    Posts
    4,307

    Default 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
    Attached Images Attached Images  

  9. #9

    Default Re: Get Registry Key Value fails on 64 bit?

    Quote Originally Posted by linder View Post
    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).

  10. #10
    Join Date
    Mar 2004
    Posts
    4,307

    Default 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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •