Archive: Registry with full permission


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.


http://stackoverflow.com/questions/1...ull-permission


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


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?


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.


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...