1

For reference, it is the HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE key. When I look into it, I see only 1 (inst_loc) subkey, and the two subkeys I added for the purposes of my application.

However, when the application (run under the same user account) reads it, it doesn't see the two keys I added, but sees a TON of other keys, like ORACLE_HOME, etc.

This finds a ton of keys, but not the two I added:

RegistryKey regkey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\ORACLE", false);
foreach (string name in regkey.GetValueNames()) { }

Anyone have an idea about the cause of this discrepancy?

EDIT: I have done a bit of digging. It seems that when I load LocalMachine.OpenSubKey("SOFTWARE\ORACLE", I actually get HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432NODE\ORACLE. But what if the value on the client machine is in HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE? I must be able to somehow access this, preferably check for the value in both places...

Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
svinja
  • 5,495
  • 5
  • 25
  • 43
  • What is your OS (x32 or x64)? Is the app x32 or x64? – Stelian Matei Feb 22 '12 at 11:02
  • 1
    Look in HKLM\Software\Wow6432Node\Oracle. Project + Properties, Compile tab, Platform target matters. – Hans Passant Feb 22 '12 at 11:03
  • OS is x64, application is x32. I guess I could compile the application as either, but the thing is, I need to be able to access both places from one application. I can't rely on the application that wrote the keys being the same type (32 or 64) as my application. – svinja Feb 22 '12 at 11:05
  • This was already answered here: http://stackoverflow.com/questions/8959983/c-sharp-wow6432-registry-node-messin-things-up – zmbq Feb 22 '12 at 11:30
  • I found a very good [web page](http://www.rhyous.com/2011/01/24/how-read-the-64-bit-registry-from-a-32-bit-application-or-vice-versa/) on this in the answers to another stackoverflow question (it has code and links to related articles) – svinja Feb 22 '12 at 14:53

0 Answers0