如何在Inno Setup iss文件中添加DLL函数? [英] How to add DLL function into Inno Setup iss file?

查看:245
本文介绍了如何在Inno Setup iss文件中添加DLL函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图阅读有关如何在Inno Setup上加载DLL的示例代码,但我感到困惑。

I tried to read sample code for how to load DLL at Inno Setup, but I'm confused.

我有一个DLL( ChkArchInfo.dll ),内容很简单:

I have one DLL (ChkArchInfo.dll) and the contents is simple:

extern "C" __declspec(dllexport) bool __stdcall IsARM()
{
    SYSTEM_INFO si; 
    GetNativeSystemInfo(&si); 

    if(PROCESSOR_ARCHITECTURE_ARM == si.wProcessorArchitecture)
       return true;

    return false;
}

我知道我需要使用 [文件] 部分以加载DLL文件。
但是如何在.iss上声明此函数以让我使用它?

I know I need to use [Files] section to load the DLL file. But how to declare this function at .iss to let me use it?

BTW,如果Inno Setup中有任何函数可以让ARM进行架构设计? ( ProcessorArchitecture 不包括ARM体系结构)

BTW, If there any functions in Inno Setup to get ARM architectute? (ProcessorArchitecture doesn't include ARM architectute)

请帮助我做...。
谢谢!!!

Please help me to do.... Thank you!!!

BR,
艾伦

BR, Alan

推荐答案

使用DLL和.NET程序集上阅读Inno Setup文档。

Read the Inno Setup documentation on Using DLLs and .NET assemblies.

首先必须声明一个外部函数原型。如果要将DLL嵌入到安装程序中,请将DLL添加到 [Files] 部分。

You primarily have to declare an external function prototype. And add the DLL to the [Files] section, if you want to embed the DLL into the installer.

[Files]
Source: "MyDll.dll"; Flags: dontcopy



[Code]
function IsARM: Boolean;
  external 'IsARM@files:MyDll.dll stdcall';






尽管最好将<$直接从Pascal脚本访问c $ c> GetNativeSystemInfo 。但这是一个不同的问题。


Though it would be better to call the GetNativeSystemInfo from Pascal Script directly. But that's a different question.

这篇关于如何在Inno Setup iss文件中添加DLL函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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