Can someone tell me what is wrong with this code?
[Code]
const
OldVersionRegKey = '\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppId}_is1';
var
HasOldVersion: Boolean;
function GetKey : Integer;
begin
if IsWin64 then
Result := HKLM64
else
Result := HKLM32;
end;
procedure CheckOldVersion;
begin
HasOldVersion := RegKeyExists(GetKey, OldVersionRegKey);
// ...
end;
Because whatever I do the answer is False while the key does exist?
I have tried everything, the key is not in the false result register, the key is in the false result register, on different levels of the database, on the 32 bit database, on the 64 bit database, test on both depending on the architecture (like the current code), but nothing to do, the result and always the same.
Thank you in advance for your help.