Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Register COM object on first program start

Tags:

com

delphi

I have a Delphi application with an automation object. On the start of the program, I want to register the COM object automatically in the registry (instead of using the /regserver switch).

The old version of the program was written in Delphi 7 and I think I remember that this version registered itself after program start. But now it's compiled with D2009 and it doesn't register itself now. Maybe somebody know something about this?

Thank you very much!

like image 327
gonzales Avatar asked Jun 12 '26 14:06

gonzales


1 Answers

This is probably failing because you are running on a machine with UAC and you don't have rights to write to HKLM. You aren't going to find a satisfactory solution using the /regserver switch because it will always try to write there.

You could switch to registry free COM, although it might just be better to do the registration as part of installation. That's when you are expected to do it because that's when you know that you will have sufficient rights.

like image 51
David Heffernan Avatar answered Jun 15 '26 10:06

David Heffernan