我使用此代码来了解密钥是否存在:
if RegKeyExists(HKEY_LOCAL_MACHINE, 'Software\Autodesk') then
begin
MsgBox('Key exists!!', mbInformation, MB_OK);
end;
Run Code Online (Sandbox Code Playgroud)
对于这个例子,它有效,我有消息框,但有了它,它没有:
if RegKeyExists(HKEY_LOCAL_MACHINE, 'Software\Autodesk\Maya') then
begin
MsgBox('Key exists!!', mbInformation, MB_OK);
end;
Run Code Online (Sandbox Code Playgroud)
但是"Maya"键存在于我的电脑上.有谁能够帮我 ?
编辑:
实际上,似乎inno-setup不能访问正确的键...例如,使用此代码我列出了所有子键Maya,但是(!)结果是所有子键HKEY_LOCAL_MACHINE\SOFTWARE...
if RegGetSubkeyNames(HKEY_LOCAL_MACHINE, 'SOFTWARE', Names) then
begin
S := '';
for I := 0 to GetArrayLength(Names)-1 do
S := S + Names[I] + #13#10;
MsgBox('List of subkeys:'#13#10#13#10 + S, mbInformation, MB_OK);
end;
Run Code Online (Sandbox Code Playgroud)
为什么这个HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node关键?