开发者

How do I change the file extension for dependencies

开发者 https://www.devze.com 2022-12-24 09:54 出处:网络
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 e

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 l开发者_高级运维ook 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?


Use the {$E} directive.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号