I am trying to read the Machine GUID from the Windows registry using Inno setup pascal scripting function RegQueryStringValue. The registry key I am after is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\MachineGuid
procedure StoreHwID();
var
HwId: String;
begin
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Cryptography','MachineGuid', HwId);
MsgBox('Value is "' + HwId + '"', mbInformation, MB_OK);
end;
This fails to set a value in the HwId variable.
What am I missing?