如何确保正确的“需求”创建安装程序时从设计时包中定义 Delphi 运行时包
我正在为当前没有的组件创建一个安装程序(例如优秀的 SynEdit 编辑器库),这也让我比以前更好地理解设计和运行时包。
我想确保最干净的部署,所以我知道许多单元将进入运行时包,并且及时我可以使用“使用运行时包构建”进行部署,这样就很好了。但通常,设计时包需要运行时包,这就是我遇到麻烦的地方。通常,我会创建一个项目组,其中包含运行时包项目 (xxx-RXE),后跟设计时包项目 (xxx-DXE)。构建一切,一切都很好。我将这两个包以 BPL、DCP 和 DCU 形式部署在我自己的库路径中,并且 使用注册表将设计时包安装到 IDE。然后将库路径添加到环境设置中。当我打开 Delphi 时(对于 D7 和 XE 都是如此),我得到“无法加载包 XXXX-DXE,未找到库包 xxx-RXE.bpl”。如果我通过修改设计时包来从“requires”中删除 xxx-RXE.dcp 并直接用单位替换它,一切都很好。
我试图避免将任何内容放入Delphi文件夹中,所以我的项目结构是这样的(仅显示XE,D7类似)。包设置为输出单元,bpl 和 dcp 设置为“..\Library\Delphi15”,所有包都指定搜索路径“..\Source”,设计时包指定附加搜索路径“..\Library” \Delphi15”(查找所需的运行时包)。
\Root
\Packages
xxx.groupproj
xxx-RXE.dpk
xxx-DXE.dpk
\Library
\Delphi15
(output of all dcus, dcp's, bpl's etc. Manually added *.res, *.inc and *.dfm's).
\Source
(The original project source files as used by the packages).
Delphi 不使用上述文件夹,在安装程序创建以下部署文件夹之前,我不会对 Delphi IDE 执行任何操作:(
c:\Program Files\xxx\Library\Delphi15
包含所有 BPL、DCP、DCU 等,这也是放入环境库路径中的路径)。
所以我不清楚的是,如果所有文件都在该文件夹中并且有路径,为什么delphi看不到它们?
感谢您的任何帮助。
I am creating an installer for components that currently do not have one (for example the excellent SynEdit editor library), this has also allowed me to get to understand design and run-time packages better than I did.
I want to ensure the cleanest deployement, so I understand that many units will go into a runtime package, and in time I may deploy using 'build with runtime packages' so that's all good. Often though, the design-time package requires the runtime package and this is where I'm getting into trouble. Typically I create a project group which has the runtime package project (xxx-RXE) followed by the design-time package project (xxx-DXE). Do a build all and everything is fine. I deploy both packages in BPL, DCP and DCU form within a library path of my own and install the design-time package into the IDE using the registry. The library path is then added to the environment settings. When I open Delphi (this is true for D7 as well as XE) I get 'Cannot load package XXXX-DXE, library package xxx-RXE.bpl not found. If I cheat by modifying the design-time package to remove xxx-RXE.dcp from 'requires' and replace this with the units directly, all is fine.
I am trying to avoid poking anything into Delphi folders, so my project structure is like this (only XE is shown, D7 is similar). The packages are set to output units, bpl and dcp to "..\Library\Delphi15", all packages are given a search path of "..\Source" and the design time package an additional search path of "..\Library\Delphi15" (to find the runtime package it requires).
\Root
\Packages
xxx.groupproj
xxx-RXE.dpk
xxx-DXE.dpk
\Library
\Delphi15
(output of all dcus, dcp's, bpl's etc. Manually added *.res, *.inc and *.dfm's).
\Source
(The original project source files as used by the packages).
None of the above folders are used by Delphi, I dont do anything with the Delphi IDE until my installer has created the following deployment folder:
c:\Program Files\xxx\Library\Delphi15
(contains all BPL's, DCP's, DCU's etc etc, that is also the path put into the environment library path).
So what I'm not clear about is that if all of the files are in that folder with a path to it, why cant delphi see them?
Thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
仅仅阅读“无法加载包 XXXX-DXE,未找到库包 xxx-RXE.bpl”就引发了不好的回忆。通常,当包含 DCP(和/或 BPL?)的路径未包含在 Windows 环境变量 PATH 中时,我会收到此错误。
当已安装的软件包引用另一个软件包时,该引用的软件包的正常“Windows 库搜索行为”就会启动(在 Delphi 启动时)。 此时没有处于活动状态的 Delphi 路径配置。因此,您的安装程序还需要修改 PATH 环境变量(或复制已包含的文件)。
Just reading "Cannot load package XXXX-DXE, library package xxx-RXE.bpl not found" triggered bad memories. Usually I got this error when the path containing the DCP (and/or BPL?) is not contained in the Windows environment variable PATH.
When an installed package references another package then the normal "Windows library search behavior" for this referenced package kicks an (on Delphi startup). No Delphi path configurations are active at this time. Thus your installer needs to modify the PATH env variable as well (or copy the file some place already contained).
我非常确定 DCP 必须位于 Delphi 的 DCP 文件夹中。在我的装有 Delphi 2010 和 Windows 7 的计算机上,它位于
C:\Users\Public\Documents\Rad Studio\7.0\Dcp
中。在注册表中搜索,可以在
Package DCP Output
值下的HKCU\Software\Codegear\BDS\7.0\Library
中找到此路径。当然,您必须扩展该字符串,因为它的形式为$(BDSCOMMONDIR)\Dcp
。我还将运行时 BPL 放在 Delphi 默认位置,(对我来说)同样是 C:\Users\Public\Documents\Rad Studio\7.0\Dcp。
I'm pretty sure that the DCP has to be in Delphi's DCP folder. On my machine with Delphi 2010 and Windows 7, it's in
C:\Users\Public\Documents\Rad Studio\7.0\Dcp
.Searching around the registry, this path is found in
HKCU\Software\Codegear\BDS\7.0\Library
under the valuePackage DCP Output
. Of course you'll have to expand the string, because it's in there as$(BDSCOMMONDIR)\Dcp
.I would also put the runtime BPL in the Delphi default location as well, which again (for me) is
C:\Users\Public\Documents\Rad Studio\7.0\Dcp
.“未找到库包 xxx-RXE.bpl”可能会产生误导。我相信这实际上意味着
LoadPackage
由于某种原因失败了。这可能是由 Windows 路径中不存在的依赖包引起的。"library package xxx-RXE.bpl not found" might be misleading. I believe it in fact means
LoadPackage
failed, for some reason. This might be caused by a dependent package not present in Windows path.