如何在Inno Setup iss文件上调用GetNativeSystemInfo ?



我想在Inno Setup iss文件调用Windows API:GetNativeSystemInfo,所以我不必调用外部DLL来检测ARM处理器体系结构。
但是我不知道如何添加它...

有人可以告诉我如何在 Inno 脚本中导入和使用该功能吗???

谢谢!

API 声明:

type
TSystemInfo = record
wProcessorArchitecture: Word;
wReserved: Word;
dwPageSize: DWORD;
lpMinimumApplicationAddress: Cardinal;
lpMaximumApplicationAddress: Cardinal;
dwActiveProcessorMask: DWORD_PTR;
dwNumberOfProcessors: DWORD;
dwProcessorType: DWORD;
dwAllocationGranularity: DWORD;
wProcessorLevel: Word;
wProcessorRevision: Word;
end;
const
PROCESSOR_ARCHITECTURE_INTEL            = 0;
PROCESSOR_ARCHITECTURE_MIPS             = 1;
PROCESSOR_ARCHITECTURE_ALPHA            = 2;
PROCESSOR_ARCHITECTURE_PPC              = 3;
PROCESSOR_ARCHITECTURE_SHX              = 4;
PROCESSOR_ARCHITECTURE_ARM              = 5;
PROCESSOR_ARCHITECTURE_IA64             = 6;
PROCESSOR_ARCHITECTURE_ALPHA64          = 7;
PROCESSOR_ARCHITECTURE_MSIL             = 8;
PROCESSOR_ARCHITECTURE_AMD64            = 9;
PROCESSOR_ARCHITECTURE_IA32_ON_WIN64    = 10;
procedure GetNativeSystemInfo(var lpSystemInformation: TSystemInfo);
external 'GetNativeSystemInfo@Kernel32.dll stdcall';

并使用:

var
SystemInfo: TSystemInfo;
begin
GetNativeSystemInfo(SystemInfo);
if SystemInfo.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_ARM then
begin
{ ... }
end;
end;

相关内容

  • 没有找到相关文章

最新更新