I\'ve several long-standing apps written in Delphi that persist their settings in the registry. I\'ve used HKEY_LOCAL_MACHINE for \'hard\' settings such as configuration pre
You can read from HKLM as a non-admin user; you just can't write to it.
Use TRegistry.Create(KEY_READ) when constructing it, and set the RootKey to HKLM.
var
Reg: TRegistry;
begin
Reg := TRegistry.Create(KEY_READ)
try
Reg.RootKey := HKLM;
// Read value here
finally
Reg.Free;
end;
end;
You can also use TRegistry.OpenKeyReadOnly() when opening a specific registry key; this helps with non-admin access to areas of the registry as well.