all:
I'd like to check reg key in Inno Setup script. Though the reg key (HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip) exist, the script can't detect it. But if I use the reg key (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v2.0) to test, it can detect the reg key. It seems that if the depth of the reg key is only 3, it can't be detected.
if not RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\7-Zip') then
begin
MsgBox('Please install 7 zip first',mbError,MB_OK);
Result := false;
end;