Create 64 bit registry key (non-WOW64) from a 32 bit application

James Newton-King picture James Newton-King · Feb 4, 2010 · Viewed 9.6k times · Source

I have a Visual Studio installer that is creating some registry keys:

HKEY_LOCAL_MACHINE\SOFTWARE\MyApp

but the registry keys it is creating are automatically appearing under Wow6432Node:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\MyApp

How do I ignore the Wow6432Node when creating registry keys in my C# code being executed by the msi?

Answer

ClairelyClaire picture ClairelyClaire · May 28, 2010

Just FYI, .NET 4.0 supports this natively. Example:

RegistryBase = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);

You can then use that RegistryBase variable to access anything in the 64-bit view of HKLM. Conversely, Registry32 will let a 64-bit application access the 32-bit view of the registry.