Determining Delphi Runtime Packages to Include

I have a Delphi DLL that houses a form which uses a variety of third party components. This DLL is used by many different versions of Delphi. I compile the third party components into the DLL. I believe I still need to link to some "base" Delphi packages like rtl, vcl, etc, so my DLL will use the same memory manager and other global resources that the Delphi IDE is using. How do I find out what BPLs I need to link to?

Ideally I'd like to point some utility at my DLL or project and have it list every BPL that it would depend on if I was only using BPL's and had no source files available. Then I could view that list and pick the packages I want to load at runtime. The current list given in the project properties under "Runtime Packages" is incomplete (as it has been tweaked over the years).

13.10.2009 20:02:40
4 ОТВЕТА
РЕШЕНИЕ

Check the "Build with Runtime Packages", leaving the whole list of packages the way it is.

Do a Project|Build (not compile!). After the build completes, use Project|View Information on ; the resulting dialog will give you a list of the actual packages you need to distribute.

After Jeremy's comment about the default list of packages being empty when he enables building with packages, here's the list from that options dialog from Delphi 2010:

   vclx;vcl;vclimg;dbrtl;Rave77VCL;bdertl;rtl;vclactnband;xmlrtl;
   vcldb;vcldbx;vcltouch;dsnap;dsnapcon;TeeUI;TeeDB;Tee;vclib;
   ibxpress;adortl;IndyCore;IndySystem;IndyProtocols;inet;
   intrawebdb_100_140;Intraweb_100_140;VclSmp;vclie;inetdb;
   webdsnap;websnap;inetdbbde;inetdbxpress;soaprtl;vclribbon;
   DbxCommonDriver;DbxClientDriver;DBXInterBaseDriver;DBXMySQLDriver;
   dbexpress;dbxcds;SynEdit_R2009
5
13.10.2009 20:24:12
This shows the statically linked packages, but if you load one at run time, there is no way to get this information with any static analysis tool
Robert Love 13.10.2009 20:13:30
Hi Ken, thanks for the reply. I'm using Delphi 2010. There isn't a Project|View Information menu item, only the OK button to close the build dialog. Also note my comment that the current list of runtime packages is incomplete (right now it just has vcl in the list).
Jeremy Mullin 13.10.2009 20:18:07
@Jeremy: Yes, there is. It's in the Project menu and enabled after build. It appears they've changed the menu text slightly, however, to "Information for <YourProject>" on that menu. To clarify, it's not in the build dialog; it's on the IDE's main project menu after you close the build dialog.
Ken White 13.10.2009 20:20:09
@Robert: You're correct, but that wasn't the original question. :-)
Ken White 13.10.2009 20:20:58
Thanks Ken, it's working now, thanks! I'm assuming with this architecture I need to have ShareMem as the first unit referenced in my DLL, does that sound correct? I'm passing string references between my Delphi design time package and this DLL.
Jeremy Mullin 13.10.2009 20:38:15

Check a tool I wrote called "Required" - you can download from http://www.drbob42.com/tools

9
13.10.2009 20:36:46
Thanks Bob. I got the info I needed from the IDE via the "Project -> Information for <Project>" menu, but I tried your utility and it worked too. :)
Jeremy Mullin 13.10.2009 20:48:47
Access to the path '\\etnaedndb02.embarcadero.com\f\webcache\cc\2002\7\31\18561.zip' is denied
Migrate2Lazarus see my profile 6.07.2018 09:16:57

"This DLL is used by many different versions of Delphi."

Do you mean that you have programs written with Delphi 7 and other programs written with Delphi 2007 etc. that use the same precompiled DLL?

In that case you cannot use any packages to share object types and memory between program and DLL because they will use different versions of the packages wich are not compatible.

1
14.10.2009 08:02:43
The DLL contains property editors used by different versions of Delphi. My Delphi design time package calls into the DLL. I don't pass object types between the design time package and the DLL, only "basic" types like strings, integers, etc. I believe because I am passing strings I need to use ShareMem.
Jeremy Mullin 14.10.2009 15:12:49
If you're passing strings, then yes, you'll need to use ShareMem. Then there's the question of whether the IDE also uses ShareMem. If it doesn't, then you can't pass strings. Pass PAnsiChar or PWideChar instead.
Rob Kennedy 14.10.2009 15:40:03

You can evaluate tools like, Dependency Walker (depends) or PE Information (image bellow) included at GExperts.

PE Information

2
20.06.2015 18:25:24