Old 16th November 2017, 20:52   #1
pkonduru
Member
 
Join Date: Jul 2015
Posts: 62
delete registry key with wild card

Is it possible to do something like this in NSIS:

DeleteRegKey HKLM "SOFTWARE\Microsoft\MyProduct*"

I know the alternative is to do an Enum and find the correct registry key but was wondering if anyone got this working with a wildcard because supposedly something like this works :

DeleteRegKey HKLM "SOFTWARE\Microsoft\MyCompany\*"

removes all the registry keys under
SOFTWARE\Microsoft\MyCompany\

Thank you for your replies.
pkonduru is offline   Reply With Quote
Old 17th November 2017, 00:18   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,869
No, there is no wildcard support for that in NSIS nor Windows.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 17th November 2017, 18:12   #3
pkonduru
Member
 
Join Date: Jul 2015
Posts: 62
Thanks Anders!
pkonduru is offline   Reply With Quote
Old Today, 15:52   #4
need9989
Junior Member
 
Join Date: Feb 2017
Posts: 3
# Registry query
nsExec::ExecToStack 'CMD /C "reg query "HKLM" /s /f "Enum" /k"' $0
pop $0
pop $1

#Remove the line break
${WordReplace} "$1" "$\r" "" "+" $1

### Then continue the query and delete it with the loop
need9989 is offline   Reply With Quote
Old Today, 17:59   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,869
Quote:
Originally Posted by need9989 View Post
nsExec::ExecToStack 'CMD /C "reg query "HKLM" /s /f "Enum" /k"' $0
pop $0
pop $1
You don't need nsExec, NSIS can enum registry keys and values with its registry instructions.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump