views:

101

answers:

2

I'm building a program that uses Delphi Packages (BPLs) as plugins, but I'd like to use a custom extension to show that the files have a specific purpose instead of just being BPLs. That works well enough until I end up with one package having a dependency on another. Then the compiler automatically creates the binary with the extension BPL built in.

This wouldn't be too hard to fix with a hex editor, but that's sort of an extreme solution. Is there any way I could make the compiler generate the packages with the right dependency names in the first place?

EDIT: The answers so far seem to have not understood the question.

I know exactly how to create the packages with my custom TEP extension instead of a BPL extension. But if I have package1.TEP and package2.TEP, and package2 depends on package1, and then I try to load package2, it gives an error because it can't find "package1.BPL". What I want is to find some simpler way to make package2 look for the correct filename, "package1.TEP," that doesn't involve editing the binary after it's been created. Is there any way to do that?

A: 

The simplest solution would be to use a post build event to rename your destination file from *.BPL to whatever specific extension you are requiring.

EDIT: You could write a separate patch program to search for and patch the offending binaries and run it as part of the post build process. If a patch is made to the compiler, then you can remove your step easily.

skamradt
I've already got that. It's not the filename I'm worried about changing, it's the references to it in other packages that depend on it.
Mason Wheeler
Ah, so this is starting to sound like a defect. I would report it via QualityCentral.
skamradt
A: 

Use the {$E} directive.

TOndrej
No. Again, this is not what I'm looking for.
Mason Wheeler
I just tried it and it worked. Just ignore the IDE messages. At runtime everything is fine, also the static imports are correct, with changed extension - I checked it with the dependency viewer.
TOndrej