Inno设置Regkeyexists返回false,尽管密钥存在
有人可以告诉我这个代码怎么了?
[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;
因为无论我做什么,答案都是false
,而键确实存在?
我已经尝试了所有内容,关键不在错误结果寄存器中,关键在于错误结果寄存器中,在数据库的不同级别,在32位数据库上,在64位数据库上,根据架构进行测试(就像当前的代码一样),但无事可做,结果总是相同的。
预先感谢您的帮助。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
关键路径的开头不应斜线。检查
而且由于您不使用 64-bit安装模式 hklm32 。
或者,如果您希望脚本与64位安装模式兼容,请使用 is64bitinstallMode ,而不是
iswin64
。There should be no slash at the beginning of the key path. Check the example in
RegKeyExists
documentation.And as you are not using 64-bit install mode, the root key is always
HKLM32
.Or, if you want the script to be compatible with 64-bit install mode, use
Is64BitInstallMode
, instead ofIsWin64
.