sebapi

Hello!
I create some keys in registry and I want to each user has full rights to this keys.
So I use AddAccessRule like:

RegistrySecurity rs = new RegistrySecurity();
rs.AddAccessRule(new RegistryAccessRule("Users", RegistryRights.FullControl, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow));
key = Registry.LocalMachine.CreateSubKey(someKey, RegistryKeyPermissionCheck.ReadWriteSubTree, rs);
key.SetAccessControl(rs);


It works when I run this on english version of OS because there is user group like 'Users'. But it does not work on other language version of OS (there isn't any group like 'Users').
How to solve this problem

Thanks a lot.
Sebastian


Re: Visual C# General How to give all users full rights to registry key ?

Sean Hederman

Offhand I'd say that you'd have to test against the language versions you want to support, and update your app to handle each language.






Re: Visual C# General How to give all users full rights to registry key ?

Mark Dawson

I am not sure how to do this in C# but if you were to use Win32 methods then you would set a NULL DACL on the registry key allowing everyone acces to the key, without having to use a strong representation of the group. I am sure that there must be a .Net class that maps to a SecurityDescriptor in which you can set null the the DACL, maybe something to look up.

Mark.






Re: Visual C# General How to give all users full rights to registry key ?

sebapi

Hello!
I've do this like here: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=223890&SiteID=1
And it seems to work.

Sebastian