Old 15th April 2013, 15:13   #1
winman2004
Member
 
Join Date: Nov 2009
Location: Mangalore-Karnataka-India
Posts: 87
Registry with full permission

I am trying to give full permission for a registry in nsis but its not working.Below is a sample code.
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Demo\" "mydemo" "abc"
AccessControl::GrantOnRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Demo\" "PC116\Users" "FullAccess"

I tried doing it in a windows XP PC. I tried using REGINI using a vbscript which gives full permission for user "Everyone".So can anyone help me on this.
winman2004 is offline   Reply With Quote
Old 16th April 2013, 00:58   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
http://stackoverflow.com/questions/1...ull-permission

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 17th April 2013, 14:34   #3
winman2004
Member
 
Join Date: Nov 2009
Location: Mangalore-Karnataka-India
Posts: 87
As you have told i have done the coding in NSIS and created registry.
When i checked permission for that registry in regedit(by right clicking node and then permission) the users group has got full permission.
Then i used a vb6 code by using RegSetValueEx function which writes and modifies the registry value of registry which i created.
Now in windows 8 and windows 7 PC i just run the vb6 code(i created exe file) and found that registry is not changing for users.Even if i run in administrator the registry is not changing.
when i run the same using run as administrator the registry changes.
So what is the use of the access control if i am not able to change with just a user login?
I think windows 8 is done such a way that registry cannot be edited without running it as administrator.
There is also an interesting this if i change registry manually by using regedit and then changing key manually then it works.I mean access control helps in this case. But any developer will be wanting to change registry using code which it does not allow.
So please help me on this.
Also see the thread here for more information
Thank you
winman2004 is offline   Reply With Quote
Old 28th April 2013, 15:48   #4
Davemays
Junior Member
 
Join Date: Apr 2013
Posts: 2
Same issuse?

I am using Windows 7 and trying to set the permissions on a Software key that I have created.


SetRegView 64
AccessControl::GrantOnRegKey HKLM "SOFTWARE\test" "S-1-5-32-545" "FullAccess"
Pop $R0
${If} $R0 == error
Pop $R0
DetailPrint `AccessControl error: $R0`
${EndIf}


Doing this I get the error:

Wrote HKLM\SOFTWARE\test
AccessControl error: Cannot build new access control list. Error code: 1332
Completed


Any ideas?
Davemays is offline   Reply With Quote
Old 28th April 2013, 16:09   #5
Davemays
Junior Member
 
Join Date: Apr 2013
Posts: 2
Fixed.

Found what the problem was, it doesn't like the " " of the SID for some reason.

!define StringSID_BUILTIN_Users S-1-5-32-545
AccessControl::GrantOnRegKey HKLM "SOFTWARE\test" "(${StringSID_BUILTIN_Users})" "FullAccess"


Works like a charm now.
Davemays is offline   Reply With Quote
Old 28th April 2013, 20:23   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
Your first post used "SID-xxx" but the required format is "(SID-xxx)", one set of quotes should not matter if there are no spaces, the compiler will strip them away so they are never passed to the plugin...

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