Yes, sorry, I figured out what was wrong right about the same time I woke up and went home ... EnumRegValue is what I really wanted rather than EnumRegKey ;-)
Thanks for the cool fn/macro and the ideas with the self-generating labels. I've never tried that before -- didn't know it would work ;-)
I love these forums ... I get so much inspiration sometimes just by glancing through 'em!
AnalogKid
=^{D}
IfKeyExists??
36 posts
Originally posted by VytautasI still don't understand.
As for the other problem. 'DisplayName' is NOT a key, keys appear as folders in regedit, so thats why the function does not work.
This checks for the "(Default)" name which something every key (folder 😉) has.ClearErrors
ReadRegStr $5 HKCR ".art\ShellEx.test" ""
Iferrors "" noter
MessageBox MB_OK "error"
noter:
The only fault I can imagine is what kichik says: that the error flag could be triggered when it can't be opened because of security or can't be queried.
Although every key has that entry it is not set, e.g. is Null, and therefore NSIS sets the error flag as if the entry did not exist.
Vytautas
Vytautas
Why doesn't this code work?
Hi,
I try to use your macro to check for a certain registry key, this is my code:
[...]
;Check if the standard Cygwin Registry keys exist (x32)
!insertmacro IfKeyExists HKLM "SOFTWARE\Cygnus Solutions\Cygwin\mounts v2" "cygdrive flags"
Pop $R0
IntCmp $R0 0 DoInstall ByReg ByReg
;Check if the standard Cygwin Registry keys exist (x64)
!insertmacro IfKeyExists HKLM "SOFTWARE\Wow6432Node\Cygnus Solutions\Cygwin\mounts v2" "cygdrive flags"
Pop $R0
IntCmp $R0 0 DoInstall ByReg ByReg
;This is the label to jump to if a registy key is found
ByReg:
MessageBox MB_ICONSTOP "RegistryKeys for Cygwin exist on this machine. Please first remove any installation of cygwin and then restart this installer..."
Quit
;This is the label to jump to if Cygwin is not installed yet.
DoInstall:
[...]
Why wouldn't it jump to ByReg if the key is found?
Please help - I'm lost...
Regards,
Chris
Hi,
I try to use your macro to check for a certain registry key, this is my code:
[...]
;Check if the standard Cygwin Registry keys exist (x32)
!insertmacro IfKeyExists HKLM "SOFTWARE\Cygnus Solutions\Cygwin\mounts v2" "cygdrive flags"
Pop $R0
IntCmp $R0 0 DoInstall ByReg ByReg
;Check if the standard Cygwin Registry keys exist (x64)
!insertmacro IfKeyExists HKLM "SOFTWARE\Wow6432Node\Cygnus Solutions\Cygwin\mounts v2" "cygdrive flags"
Pop $R0
IntCmp $R0 0 DoInstall ByReg ByReg
;This is the label to jump to if a registy key is found
ByReg:
MessageBox MB_ICONSTOP "RegistryKeys for Cygwin exist on this machine. Please first remove any installation of cygwin and then restart this installer..."
Quit
;This is the label to jump to if Cygwin is not installed yet.
DoInstall:
[...]
Why wouldn't it jump to ByReg if the key is found?
Please help - I'm lost...
Regards,
Chris
Originally Posted by cherdeg View PostHi,
I try to use your macro to check for a certain registry key, this is my code:
[...]
;Check if the standard Cygwin Registry keys exist (x32)
!insertmacro IfKeyExists HKLM "SOFTWARE\Cygnus Solutions\Cygwin\mounts v2" "cygdrive flags"
Pop $R0
IntCmp $R0 0 DoInstall ByReg ByReg
;Check if the standard Cygwin Registry keys exist (x64)
!insertmacro IfKeyExists HKLM "SOFTWARE\Wow6432Node\Cygnus Solutions\Cygwin\mounts v2" "cygdrive flags"
Pop $R0
IntCmp $R0 0 DoInstall ByReg ByReg
;This is the label to jump to if a registy key is found
ByReg:
MessageBox MB_ICONSTOP "RegistryKeys for Cygwin exist on this machine. Please first remove any installation of cygwin and then restart this installer..."
Quit
;This is the label to jump to if Cygwin is not installed yet.
DoInstall:
[...]
Why wouldn't it jump to ByReg if the key is found?
Please help - I'm lost...
Regards,
Chris
you have 2 'ByReg'.
it should be:
Also.. if you're checking x64 reg key.. use SetRegView 64.IntCmp $R0 0 DoInstall ByReg
And use LogicLib instead of IntCmp.
Stu
Stu