8
votes

I'm using HKEY_LOCAL_MACHINE to set a variable at the time of install. These need to be seen by all users on a machine and are only read by them.

I use Inno to create the entry. It's running as admin, so it should have adequate rights that virtualization doesn't kick in ... or am I misunderstanding?

My application can read the entry (even as a limited user in Win7) BUT I can't see them in RegEdit or RegEditX 3.0. I CAN see them in RegEditX 2.0 though. Weird.

I don't understand why my Delphi app can see the entry, but the RegEdit programs above can't.

I believe that this might have something to so with virtualization (first answer here: Cannot read config data from HKEY_LOCAL_MACHINE on Vista).

But, I can't even see the registry entry in question under HKCU\Software\Classes\VirtualStore\MACHINE\SOFTWARE.

Is HKEY_LOCAL_MACHINE so deprecated that I should be avoiding it completely? How is a developer now supposed to save data for all users - just in {commomappdata}, which usually is C:\Program Data... ??

1
You might want to look into HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node if you're on 64-bit.Polynomial
@Polynomial Surely that's the answer. Why don't you post it as such?David Heffernan
Wasn't entirely sure, but looks like the case. I'll post as an answer.Polynomial
@polynomial I'm 99.9% certain this will be it. I bet that RegeditX is a 32 bit process from the old days.David Heffernan
I am reminded of Xzibit: "Yo dawg, I herd u like redirects, so we put redirects in yo redirects so you can redirect while you redirect"Polynomial

1 Answers

24
votes

64-bit versions of Windows emulate 32-bit functionality through the "Windows on Windows" (WoW) subsystem. In the case of the registry, they move the 32-bit keys over to a special subkey for compatibility reasons.

The keys will be in: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node.

This is the registry analogue of the file system redirector that maps system32 to SysWOW64.

More details can be found on the MSDN topic about the Registry Redirector.