delphi专家中的第三方依赖
我正在编写一个delphi ide Expert,带有一些第三方依赖项(视觉控件),我的问题是当这个专家将安装在目标机器上时,这台电脑是否也需要安装这些第三方组件?或者组件嵌入生成的 bpl 内部?
i am writting a delphi ide expert, with some third party dependencies (visual controls), my question is when this expert will be installed in a target machine , this pc will be requires have installed these third party components too? or the componentes are embeded inside of the bpl generated?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它们将依赖于您放置在包的 require 子句中的任何包。然后是它们需要的任何包,依此类推...
如果您将依赖的单元放入包中,则可以嵌入它们。
示例:
注意事项
避免问题的一种方法
这种方法我已经见过很多次了。
例如,Castalia 就是这样做的,而 在使用开源delphi 词法分析器和解析器。
They will be dependent on any packages you place in your package's requires clause. Then any packages they require, and so on...
They can be embedded if you place the units you depend on into your package.
Example:
Word's of Caution
One Way to avoid problems
I have seen this method done many times.
For example Castalia does this, and recommends this method when using it's open source delphi lexer and parser.
关于 BPL 专家:
如果您可以避免链接到第 3 方控件的设计时版本,而仅坚持运行时 BPL,那么您可以合法地将这些与您的专家一起交付。
不幸的是,我不能说您可以安全地运送它们,因为您正在与其他Delphi开发人员打交道:他们可能拥有相同的第3方软件包,但版本不同!对于普通的应用程序,您可以简单地将 BPL 版本安装到应用程序的目录中,但这不适用于 Delphi IDE,因为应用程序就是 IDE:IDE 是加载和链接 BPL 的那个,并且它可以不要加载同一 BPL 的两个版本。而且您无法替换用户的版本,因为他们需要保留他们许可的版本,即使您的版本较新!
解决方案:DLL 专家:
一种可能的解决方案是将专家编译为 DLL,而不是包,并静态链接所有依赖项。这样您就不再依赖用户的第三方控件版本。
About BPL experts:
If you can avoid linking to the design-time versions of the 3rd party controls, stick to runtime BPL's only, you can legally ship those with your expert as your expert.
Unfortunately I can't say you can safely ship them because you're dealing with other Delphi developers: they might have the same 3rd party packages but in a different version! With a normal application you can simply install your version of BPL's to your application's directory, but this is not going to work for a Delphi IDE because the the application is the IDE: the IDE is the one loading and linking the BPL's, and it can't load two versions of the same BPL. And you can't replace your user's version because they need to keep the version they licensed, not even if your version is newer!
The solution: DLL experts:
One possible solution is to compile your expert as a DLL, not as a package, and statically link all dependencies. That way you're no longer dependent on your user's version of the 3rd party controls.
正如 Robert Love 所说:依赖关系存在,
任何 delphi 项目都可以设置为使用或不使用包进行编译。项目|选项|套餐 |选中或取消选中“使用运行时包构建”。
当您使用包构建/编译时,这意味着您没有嵌入包中的代码,并且您必须分发专家所依赖的 bpl。正如罗伯特所说:当您选择此选项时,请注意有关重新分发的许可证。
当您不包构建/编译时,来自第三方控件/库的代码将嵌入到您的可执行文件/dll 中,这就是您必须分发的全部内容。
As Robert Love was saying: the dependencies exists,
Any delphi project can be set to compile with or without packages. Project | Options | Packages | check or uncheck the "Build with runtime packages".
When you build/compile with packages, that means you are not embedding the code from the packages and you will have to distribute the bpl's that your expert depends on. As Robert was also saying: please pay attention to the licenses with regard to redistribution when you choose this option.
When you build/compile without packages, the code from the third party controls/libraries is embedded in your executable/dll and that's all you have to distribute.