Can I run RegAsm without being Administrator?

后端 未结 5 1250
醉话见心
醉话见心 2021-02-03 12:11

My coworker is trying to register some COM components (which I wrote) via RegAsm.exe and it says he needs Administrator privileges. His account has admin privileges but he is n

5条回答
  •  走了就别回头了
    2021-02-03 12:28

    I work in an environment/jurisdiction where giving local admin access to all users is simply not possible (legal/compliance/regulations will not allow).

    It appears there is no equivalent of this function in .NET world: AtlSetPerUserRegistration

    Try this: Using regasm, generate the registry entries with /regfile argument. By default, registry entries should use HKEY_CLASSES_ROOT (HKCR) as a root. Modify the entries (manually, or by script) to use HKEY_CURRENT_USER (HKCU).

    Finally, distribute your .NET DLL with the registry script. You can still run regedit without admin rights to register your .NET DLL. Manually from the command line, using a batch file, or a (tiny) separate installation program can handle the registration.

提交回复
热议问题