Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is this a possible approach to register .NET types for COM

I have a .NET assembly and use regasm.exe to register for COM. The tlb is used by users to write code in VBA in Excel.

I did a regasm /regfile and I see that all registry entries are fallin in to 'HKEY_CLASSES_ROOT\'. I have an admin constraint (sadly) to run regasm on all user's machine since it requires admin access to write registry keys in to *HKEY_CLASSES_ROOT*.

My question is, if I change this to write to 'HKEY_LOCAL_MACHINE' or 'HKEY_CURRENT_USER', will the COM interop still work and will Excel be able to find my types ?

This way, I am thinking I can negotiate for a much less previlieges to my users so they can run this new reg file rather than runing the regasm.

Thanks Mani

like image 941
Everything Matters Avatar asked Dec 03 '25 16:12

Everything Matters


1 Answers

Sadly it's not so easy 'cause it depends on user settings, take a loot at: http://blogs.msdn.com/b/cjacks/archive/2008/06/06/per-user-com-registrations-and-elevated-processes-with-uac-on-windows-vista-sp1.aspx

like image 54
Adriano Repetti Avatar answered Dec 06 '25 17:12

Adriano Repetti



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!