Register DLL (ActiveX) for Non-Admin user

喜你入骨 提交于 2020-01-06 06:41:33

问题


I try to register dll (ActiveX) for non-admin user using MSI. To create registry settings I have register the dll in admin mode, then exported the relevant registry entries and renamed all HKLM to HKCU.

When I install it for non-admin user all works fine. But when I use the same settings with admin user, there is a problem of discovering TypeLib.

What should be changed in the registry entries to work both for admin and non-admin user, when the registration done under HKCU?

Thank you


回答1:


If your entries are really registered under HKCU, it will work. What MSI installer are you using? There should be a way to specify that it should install in user mode.

Are you letting the dll self-register or having the msi register the dll? it is best practice to have the MSI do it, but it's more of a pain. If you're having the .dll self-register you need to make sure that the dll registers in HKEY_CURRENT_USER and not HKEY_LOCAL_MACHINE, which ATL does by default.

If you built it in VS2008 with ATL, you'll want to add: AtlSetPerUserRegistration(true); to your DllRegisterServer and DllUnregisterServer.

Anyway, those are some things to look for. You can use Process Monitor and watch the Reg commands to see exactly what is happening; something somewhere is writing to HKLM.



来源:https://stackoverflow.com/questions/2250511/register-dll-activex-for-non-admin-user

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!