Registry Search - How to end search ???
I am using Instructor's Registry NSIS plugin v3.1 to perform search for all registry keys containing "VC6MYKEY":
It does find those keys correctly, but if I want to end the search by the first return of an empty string ($2==""), I can't because... ${registry::Find} returns such empty string beore finding the first occurrence of "VC6MYKEY".DeleteAllRegKeysContaining_VC6MYKEY
registry::Find} "$0" $1 $2 $3 $4 # path, value/key, string, type
${registry::Open} "HKEY_LOCAL_MACHINE\\SYSTEM" "/K=1 /V=0 /S=0 /B=1 /NI='VC6MYKEY'" $0
StrCmp$0 0 0 L_LOOP
MessageBox MB_OK"Error" IDOK L_CLOSE
L_LOOP:
${
StrCmp $2 "" 0 L_VERIFYSUBSTRING
MessageBox MB_OK"First registry::Find $0 empty??? ($1,$2,$3,$4)" IDOK L_CLOSE
L_VERIFYSUBSTRING:
Push $2 # (longer) string to be searched
Push "VC6MYKEY" # what to search for
Call un.StrStr
Pop $R0 # $R0 at this point starts with VC6MYKEY
StrCmp $R0 "" L_LOOP 0
DetailPrint "Delete registry key: $1\$2"
DeleteRegKey HKLM "$1\$2"
goto L_LOOP
L_CLOSE:
${registry::Close} "$0"
${registry::Unload}
>FunctionEnd
>
So... I may be able to understand how ${registry::Find} behaves ("every call returns, but if not found, it will return all for vars $1 $2 $3 $4 with empty strings"), but that doesn't help solve the problem that I am facing:
I need to find (and delete) all occurrences of "VC6MYKEY" under HKEY_LOCAL_MACHINE\SYSTEM.
To further clarify, all I really need is some indication that I reached "the end of the registry". For example, I tried the following test:
but it gets stuck in endless loop.L_LOOP:
registry::Find} "$0" $1 $2 $3 $4 # path, value/key, string, type
${
StrCmp $2 "" L_LOOP L_PRINTFOUND
L_PRINTFOUND:
DetailPrint "Delete registry key: $1\$2"
goto L_LOOP
>
Is there a solution to this problem?
Thanks,
Victor