View Single Post
Old 4th March 2021, 10:42   #24
stass
Senior Member
 
Join Date: Nov 2012
Posts: 166
The owner in this case does not matter.
Here is an example with the owner of TrustedInstaller.
The key is determined without problems.

Working example:

code:

!addplugindir .
!include "LogicLib.nsh"
!include "Registry.nsh"
OutFile "IfKeyExist-test.exe"
RequestExecutionLevel admin
Var NameKey

Section
StrCpy $NameKey "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\AGP"
ClearErrors
${registry::KeyExists} "$NameKey" $R0
${If} $R0 = -1
MessageBox MB_OK "NO Key"
${ElseIf} $R0 = 0
MessageBox MB_OK "OK!"
${EndIf}
${registry::unload}
SectionEnd

stass is offline   Reply With Quote