Is it possible to recompile the DataSnap packages

2019-02-13 00:41发布

问题:

Okay -- we have an interesting problem.

Some background:

  1. Our main application uses Indy 10. However, we take the Indy 10 source and fix bugs in it, recompile, and install our own set of Indy components.

  2. We are migrating to Delphi XE and want to start using DataSnap.

  3. DataSnap requires the "official, shipping" version of Indy which is incompatible with our customized version of Indy.

  4. Our DataSnap servers will be separate applications, but since we have our own Indy installed in the IDE, we can't "cross the streams".

Okay, therefore, we are unable to use Delphi XE's DataSnap out of the box because of this compatibility issue.

So my questions is this:

Is it possible to recompile the DataSnap packages in Delphi XE with a new/different version of Indy?

Your thoughts gratefully accepted.

回答1:

The common belief is No, that's not possible due to not all sources being provided by Embarcadero and some of these sources are reliant on the build of Indy as shipped. (Which is extremely frustrating to end users as the version of Indy that ships with Delphi is out of date relatively quickly and sometimes the version selected at the time is not necessarily a very good one.)

See related SO question: Is it possible to use Indy 10.5.8.0 in Delphi XE and DataSnap?

Also see the Indy project page: http://www.indyproject.org/Sockets/Docs/indy10Installation.de.aspx which states:

Note: In D/CB/RAD 2009+, DataSnap uses Indy 10 internally. Installing a new version of Indy will render DataSnap unusable, as it will not be able to load the Indy packages anymore. DataSnap is compiled against the Indy packages that ship with the IDE, and DataSnap cannot be recompiled by end users. If you need to use DataSnap, then you will need to maintain the original Indy 10 packages for use in DataSnap projects.

It's been said that the next version should hopefully allow for easier updates of Indy.



回答2:

If all DataSnap source is included, is of course possible using some kind of PE executable analisys program to detect which classes and units are used in BPL (as BPLs are just customized DLLs). An very easy one to use is provided with GExperts.

In BPLs, the exports list lines from GExperts\PE Information have an format like @xp$@[nn][UnitName]@[TypeName] (for types) and @[UnitName]{@[Type>]}@[Unit global element like procedures or variables] (for the rest).

You can save that list to a file and GREP to get an list of Units used on a BPL.

Real Examples (vcl140.bpl):

  • @$xp$11Forms@TForm
  • @Appevnts@TCustomApplicationEvents@Activate
  • @Clipbrd@Clipboard