安装软件包时无法加载软件包%s错误 [英] Can't load package %s error while installing a package

查看:222
本文介绍了安装软件包时无法加载软件包%s错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Delphi 2007上进行测试,我的groupproject由2个软件包组成.

I'm testing on Delphi 2007 and my groupproject is composed by 2 packages.

PackageRun.bpl

它被标记为仅运行时",并且包含一个名为"uMyTestRun.pas"的单元,其中定义了一个空的TFrame后代:

It's marked as "runtime only" and contains a unit named "uMyTestRun.pas" in which is defined an empty TFrame descendant:

unit uMyTestRun;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 
  Dialogs;

type
  TMyTest = class(TFrame)
  private
    { Private declarations }
  public
    { Public declarations }
  end;

implementation

{$R *.dfm}

end.

PackageDes.bpl

它需要PackageRun.bpl,它被标记为仅设计时",并且包含一个名为"uMyTestDes.pas"的单元,我在其中编写了以下代码:

It requires PackageRun.bpl, it's marked as "designtime only" and contains a unit named "uMyTestDes.pas" in which I wrote the following code:

unit uMyTestDes;

interface

uses
  Classes,
  uMyTestRun;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('MyComponents', [TMyTest]);
end;

end.

两个软件包的输出目录都在库路径中(内部有bpl,dcp和dcu).

Output directories of both packages are in Library paths (Inside there are bpl, dcp and dcu).

尝试安装PackageDes.bpl(组件,安装软件包...,添加...),出现以下错误:

Trying to install PackageDes.bpl (Component, Install Packages..., Add...), I'm getting the following error:

无法加载程序包C:\< ...> \ PackageDes.bpl.不可能的旅行 模数比.

Can't load package C:\<...>\PackageDes.bpl. Impossibile trovare il modulo specificato.

消息的最后部分是使用我的操作系统的语言,用英语应该是找不到指定的模块"之类的内容. (我的操作系统是Windows 10 Pro 64位).

The last part of the message is in my OS's language, in english it should be something like "Can't find specified module". (My OS is Windows 10 Pro 64bit).

PackageDes.bpl与错误消息(C:\< ...> \ PackageDes.bpl)中显示的路径完全相同. 经过一些测试,我发现通过从uMyTestDes.pas单元中删除以下行,该错误消失了:

PackageDes.bpl is exactly in the same path shown in the error message (C:\<...>\PackageDes.bpl). After some tests, I found that the error disappear by removing the following line from uMyTestDes.pas unit:

RegisterComponents('MyComponents', [TMyTest]);

我的代码/项目/环境中有问题吗?

Is there something wrong in my code/projects/environment?

推荐答案

http://SysInternals.com 运行Process Monitor并设置过滤器仅拦截Delphi IDE进程的文件操作(工具栏最右边的按钮)(在TaskManager中检查进程名称或快捷方式属性(对于Delphi XE2是bds.exe)),然后添加类似于Include/Process Name/Ends With/的过滤器 bds.exe ).

Run Process Monitor from http://SysInternals.com and set the filters to intercept only file operations ( toolbar rightmost buttons ) of your Delphi IDE process (check the process name in TaskManager or shortcut properties (it is bds.exe for Delphi XE2), then add the filter similar to Include / Process Name / Ends With / bds.exe ).

然后清除PM中的日志,切换到Delphi并尝试加载程序包,然后在错误弹出时立即切换回PM并停止捕获事件.尝试尽快执行此操作,例如不要浪费时间关闭错误框.

Then clear the log in PM, switch to Delphi and try to load the package, then as soon as error pops up switch back to PM and stop capturing events. Try to do it fast as you can, for example do not waste your time closing error box.

现在,您将获得Delphi加载您的程序包的文件I/O活动的痕迹(以及其他一些背景活动噪音-您执行得越快,噪音就越少).在该跟踪中查找所有错误,并查看Delphi尝试在何处找到哪个软件包.

Now you would get a trace of file I/O activity of Delphi loading the package of yours (and some other background activity noise - the faster you do the less noise there'd be). In that trace look for all the errors and see where and which package Delphi tries to find.

如果您的设计时BPL具有可解析的所有DLL依赖关系树,您也可以尝试使用Microsoft Dependency Walker或类似工具进行设置.我个人通常使用带有FileInfo插件或ntCore CFF Explorer的Unreal/Total指挥官.

You can also try Microsoft Dependency Walker or similar tools to se if your Design-Time BPL has all the DLL-dependency tree resolvable. Personally I usually use Unreal/Total commander with FileInfo plugin or ntCore CFF Explorer.

这篇关于安装软件包时无法加载软件包%s错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆