Old 7th January 2008, 02:38   #1
drachs
Junior Member
 
Join Date: Jan 2008
Posts: 3
How do I set permissions on a registry key?

I have been trying the following snippet from the wiki, but it only returns the error message, "Root key name missing", as if the accesscontrol plugin isn't getting my parameters, can anyone help?

Push $0 ; save
Push "Marker"
; Set registry ACL's to let "everyone (S-1-1-0)" access the registry settings
AccessControl::GrantOnRegKey HKLM "${PRODUCT_DIR_REGKEY}" "everyone" "FullAccess"
Pop $0 ; get "Marker" or error msg
StrCmp $0 "Marker" Continue
MessageBox MB_OK|MB_ICONSTOP "Error setting access control for registry: $0"
Pop $0 ; pop "Marker"
Continue:
Pop $0 ; restore
drachs is offline   Reply With Quote
Old 7th January 2008, 02:51   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
IIRC, AccessControl uses HKLM\foo\bar style paths

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 7th January 2008, 17:07   #3
drachs
Junior Member
 
Join Date: Jan 2008
Posts: 3
After expanding my variable, my AccessControl line looks like this:

AccessControl::GrantOnRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\DerbyAv.exe" "everyone" "FullAccess"

According to all the examples and the code that ships with the package, the HKLM should be separate, I did try them together though, and no luck.
drachs is offline   Reply With Quote
Old 7th January 2008, 18:59   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Hello, there was a bug.
http://nsis.sourceforge.net/File:AccessControl.zip

Stu
Afrow UK is offline   Reply With Quote
Old 7th January 2008, 21:33   #5
drachs
Junior Member
 
Join Date: Jan 2008
Posts: 3
Thanks Stu, I also found the one liner on my end this afternoon, it's good to know someone is maintaining this.

David
drachs 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