将DLL导入到Inno-Setup中的问题 [英] Problem with importing DLL into Inno-Setup

查看:288
本文介绍了将DLL导入到Inno-Setup中的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个innosetup安装脚本中导入一个C ++ DLL。 DLL代码如下:

  void __stdcall SetFbParam(char * dbFileName,char * dbTableName,char * dbParamName,char * dbParamValue ){
//这里没有用处,不改变任何东西}

在Innosetup,我使用

 程序FBset(dbFileName,dbTableName,dbParamName,dbParamValue:String;)导入它; 

external'SetFbParam @ files:MyDll.dll stdcall setuponly' code>



但是,在安装程序启动期间,我总是收到运行时错误,表示无法导入我的DLL。我尝试了各种调用约定,但它总是失败。
如果它是重要的,我正在使用UAC运行Win7 x64(安装程序请求权限提升和崩溃之后)。



确切的消息是:

错误

运行时错误(-1:0):

无法导入

dll:C:\Users\\ \\ Nevod\AppData\Local\Temp\is-6LOEC.tmp\MyDll.dll



dll在那里。



谢谢!

解决方案

MyDll.dll是否32位?



MyDll.dll是否依赖于同一目录中的任何其他DLL?如果是这样,您需要在MyDll.dll之后列出这些DLL的名称,以确保在 MyDll.dll加载之前解压缩它们,并且可能需要loadwithalteredsearchpath选项以及。来自帮助的示例:

  procedure ADllFunc(hWnd:Integer; lpText,lpCaption:String; uType:Cardinal); 
external'ADllFunc @ files:A.dll,B.dll stdcall loadwithalteredsearchpath'; //A.dll依赖于B.dll


I am importing an C++ DLL in an innosetup install script. The DLL code is as follows:

void __stdcall SetFbParam(char *dbFileName,char *dbTableName,char *dbParamName,char *dbParamValue){
//of no use here and doesn't change anything}

In the Innosetup, I import it using

procedure FBset(dbFileName,dbTableName,dbParamName,dbParamValue: String;);

external 'SetFbParam@files:MyDll.dll stdcall setuponly';

However, I always get a runtime error during launch of the installer, saying that it cannot import my dll. I tried it with various calling conventions, but it always fails. If it's of any importance, I'm running Win7 x64 with UAC on ( the installer requests rights elevation and crashes after that).

The exact message is:
Error
Runtime error (at -1:0):
Cannot import
dll:C:\Users\Nevod\AppData\Local\Temp\is-6LOEC.tmp\MyDll.dll

The dll is there.

Thanks!

解决方案

Is MyDll.dll 32-bit?

Does MyDll.dll depend on any other DLLs in the same directory? If so, you need to list the name(s) of those DLLs after "MyDll.dll" to ensure that they are extracted before MyDll.dll is loaded, and you likely need the "loadwithalteredsearchpath" option as well. Example from the help:

procedure ADllFunc(hWnd: Integer; lpText, lpCaption: String; uType: Cardinal);
external 'ADllFunc@files:A.dll,B.dll stdcall loadwithalteredsearchpath'; //A.dll depends on B.dll

这篇关于将DLL导入到Inno-Setup中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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