drachs
7th January 2008 03:38 UTC
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
Anders
7th January 2008 03:51 UTC
IIRC, AccessControl uses HKLM\foo\bar style paths
drachs
7th January 2008 18:07 UTC
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.
Afrow UK
7th January 2008 19:59 UTC
Hello, there was a bug.
http://nsis.sourceforge.net/File:AccessControl.zip
Stu
drachs
7th January 2008 22:33 UTC
Thanks Stu, I also found the one liner on my end this afternoon, it's good to know someone is maintaining this.
David