简体   繁体   中英

Mass deploy Managed ActiveX control written in C# .NET 4.0

I have created a managed ActiveX control in C# (.NET 4.0) that is accessed by Office VBA (currently being called from VBA code in Dynamics). However, when looking for a method to deploy this to the masses in our company (and keep it updated), I cannot find an efficient way of doing this.

At first, I thought that I could do this somehow through ClickOnce, but after reading some articles, I don't think this will work.

Are there any suggestions? PowerShell perhaps?

I will need to update this control somewhat frequently as we add new functionality.

Any advice is greatly welcomed.

Thanks for your time,

Rob

Don't rule out ClickOnce just yet. The issue with ClickOnce is that it installs apps per-user rather than per-machine/system-wide. Because COM/ActiveX registration is typically machine/system wide, ie the registry entries are under HKLM, ClickOnce doesn't support it (due to permissions required to modify the HKLM part of the registry).

But since Windows 2000 it's possible to register COM objects in the user part of the registry: HKEY_CURRENT_USER\\Software\\Classes maps to HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes which is the same as HKEY_CLASSES_ROOT .

So, using something like RegSvrEx you should be able to ascertain the registry entries you need to create under HKCU . When you've done this, find a way of triggering this HKCU reg update when the ClickOnce install/update happens.

You could use the regasm.exe utility:

regasm.exe /codebase foo.dll

where foo.dll is the managed assembly containing the ActiveX control that you want to expose.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM