tags:

views:

85

answers:

2

Hello, I have an aplication with an automation object. in the delphi IDE I can register it via the button "register type library". As an alternative I can use codegear's tregsvr.

But how should I register the application when it's installed on other computers? Should the setup include the tregsvr.exe ? Am I allowed to contribute the tregsvr.exe? Thanks for your advice!

+5  A: 

Windows has a regsvr32.exe which is able to register DLLs (or OCXs). If your server is an EXE you should be able to register it using the command line switch /REGSERVER.

Uwe Raabe
Or If you use InnoSetup you can do this with "regserver" flag.
SimaWB
Hi, I already tried this.I have no dll (or ocx), I got a tlb..When I try to register the tlb with the command "regsvr32 blabla.tlb" I get an error which says something like "Module is not compatible with the windows version you want to execute. Check if the module is compatible with an x86-Version oder x64-Version of regsrv32.exe"But when I run "tregsvr -u blabla.tlb' it works.
doubleu
I forgot to say:I also tried to register the application via /REGSERVEROn the development machine it works, but on a test-machine I get an EOleSysError (Error accessing OLE registration)
doubleu
/REGSERVER works - I tried to run it without administrator privilegs - execute as admin worked.
doubleu
Yeah, you definitely need admin rights to register a com server.
Uwe Raabe
A: 

This mechanism is called self-registration, so your COM server library performs registration itself.

RegSvr32 yours.dll
RegSvr32 /u yours.dll

Actually, along with this, there are lot of Windows built-in registration behaviours, all of them are simple, you only need to list your file eg. in RegisterDlls INF section. Those are merely a calls to DllRegisterServer and DllUnregisterServer functions