1

I whant to get some Information from the Registry Key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration".

For some case I do not get the registry key object. For troubleshooting I've tryed the following:

RegistryKey k2 = Registry.LocalMachine.OpenSubKey("SOFTWARE");
RegistryKey k3 = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft");
RegistryKey k4 = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Office");
RegistryKey k5 = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Office\\ClickToRun");

Debuging the code this is what I've got:

k2 -> correct Object

k3 -> correct Object

k4 -> correct Object

k5 -> null

I have checked the name of the key several times and of course the key exists on the system.

When I search SubKey k4 like that:

foreach (string test in k4.GetSubKeyNames()) {
    test.ToString();
}

I can't find the key "ClickToRun" but I can find some keys that aren't shown with regedit. Tested the code with other registrykeys, it works fine.

Any ideas?

deru
  • 460
  • 1
  • 4
  • 15

1 Answers1

2

The problem was about the 64 bit registry. I have installed a 32 bit Office on a 64 bit mashine. Now I use the 64 bit registry entrys and it works fine.

See this artice for more information:

Reading 64bit Registry from a 32bit application

Community
  • 1
  • 1
deru
  • 460
  • 1
  • 4
  • 15