0
votes

How can I register a COM-visible assembly in code like REGASM?

Background: I have to deploy a dll with a legacy Delphi 5 application, but the DLL is C# written and made COM Visible.

Is there a way I can replicate this functionality dynamically in code (regasm xxx.dll), as the legacy application is launched from a network path (no local installation on all the clients).

Thanks

1
Registration free COM? - David Heffernan
Thanks - will check it out - Dane Balia
Can't you just run regasm? Why replicate its functionality when its functionality is already there? - Rob Kennedy
I do not have access to all the users of the application and their geographically spread. I'd take the easy option if I could :| - Dane Balia
@DaneBalia - what's the relation between the users of the application, their geography and the regasm tool? Why can't you use regasm exactly? - Simon Mourier

1 Answers

2
votes

You can to use the /regfile command line option to regasm, then execute the generated .reg file.

I prefer using reg.exe import "%s" instead of regedit.exe, since it will avoid a popup. Or you can write your own .reg parser and update the registry, but it may be overcomplicated.

Ensure every "CodeBase"="file://...." entry will be changed to expected (network) folder containing the COM .dll wrapper.