delphi专家中的第三方依赖

发布于 2024-11-08 01:18:14 字数 115 浏览 0 评论 0原文

我正在编写一个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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

向地狱狂奔 2024-11-15 01:18:14

它们将依赖于您放置在包的 require 子句中的任何包。然后是它们需要的任何包,依此类推...

如果您将依赖的单元放入包中,则可以嵌入它们。

示例:

package Package1;

...

// Items in the section mean that your package
// will depend on the BPL of the other package
// Target machine must have the BPL's listed here.
requires
  rtl;  


// Unit's here mean that the code is in your
// package and not in another BPL
contains
  Unit8 in 'Unit8.pas';

end.

注意事项

  • 加载的两个包包含具有相同名称的单元。
  • 第三方组件的许可,因为商业库通常不能重新打包为库。
  • 开发人员可能还想使用不同版本的第 3 方组件。您需要向这些开发人员提供源代码,以便他们可以重新链接您的专家。

避免问题的一种方法

  • 重命名所使用的第 3 方单位。
  • 在您的包中包含重命名的单元。

这种方法我已经见过很多次了。

例如,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:

package Package1;

...

// Items in the section mean that your package
// will depend on the BPL of the other package
// Target machine must have the BPL's listed here.
requires
  rtl;  


// Unit's here mean that the code is in your
// package and not in another BPL
contains
  Unit8 in 'Unit8.pas';

end.

Word's of Caution

  • Two packages loaded that contain unit's with the same name.
  • Licensing of 3rd Party Components, as commercial libraries can not typically be repackaged as a library.
  • Developers may also want to use a different version of the 3rd party component. You will need to provide source to these developers so they can relink your expert.

One Way to avoid problems

  • Rename 3rd Party units that are used.
  • Include renamed units in your package.

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.

旧城空念 2024-11-15 01:18:14

关于 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.

人间☆小暴躁 2024-11-15 01:18:14

正如 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文