HKEY_LOCAL_MACHINE\Software\MyCompany access

  • Thread starter Thread starter Dennis C. Drumm
  • Start date Start date
D

Dennis C. Drumm

Is there any way that a program running under a restricted user (not an
administrator) can aceesss a specified part of the system registry set
aside/created for its use, such as: HKEY_LOCAL_MACHINE\Software\MyCompany ?

Along those same lines, what does RegistryPermission.SetPathList,
AddPathList and GetPathList do?

Thanks,

Dennis
 
Dennis C. Drumm said:
Is there any way that a program running under a restricted user (not an
administrator) can aceesss a specified part of the system registry set
aside/created for its use, such as: HKEY_LOCAL_MACHINE\Software\MyCompany
?

Under default permissions, a non-admin would be able to read a key like
this. However, it is rather unusual for it to be necessary or desirable for
a non-admin to write to such a key. Are you sure that it wouldn't be
preferable to have non-admins write to HKEY_CURRENT_USER\Software\MyCompany
instead? If not, you will need to set permissions on the
HKLM\Software\MyCompany key to permit the write.

Along those same lines, what does RegistryPermission.SetPathList,
AddPathList and GetPathList do?

Not what you want it to. <g> RegistryPermission is a code access security
permission. It has nothing at all to do with modification of user
permissions on registry keys. There is no direct support for modifying
permissions on registry keys in version 1.x of the .NET Framework, so you
would need to modify the ACL via other means such as p/invoke calls to the
relevant Windows API functions. A web search would also reveal several
scriptable approaches that would be suitable for use as installer tasks.
 
Back
Top