From 696a317eca470f4c61fd3f736d43a00ca53d4850 Mon Sep 17 00:00:00 2001 From: anders_k Date: Thu, 1 Feb 2018 21:34:37 +0000 Subject: [PATCH] Added the GetNativeProcessorArchitecture helper macro in case you really really need to know the true native CPU type git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6981 212acab6-be3b-0410-9dea-997c60f758d6 --- Docs/src/history.but | 8 ++++++++ Include/Win/WinNT.nsh | 8 ++++++++ Include/x64.nsh | 17 +++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/Docs/src/history.but b/Docs/src/history.but index 6e03bb4d..23766830 100644 --- a/Docs/src/history.but +++ b/Docs/src/history.but @@ -1,5 +1,13 @@ \A{history} Changelog and Release Notes +\H{v3.04} 3.04 + +Released on ??? ??th, 20?? + +\S1{v3.04-cl} Changelog + +\S2{} Minor Changes + \H{v3.03} 3.03 Released on January 29th, 2018 diff --git a/Include/Win/WinNT.nsh b/Include/Win/WinNT.nsh index 837ab41b..4abfed8d 100644 --- a/Include/Win/WinNT.nsh +++ b/Include/Win/WinNT.nsh @@ -203,6 +203,14 @@ !define REG_MULTI_SZ 7 !endif +!define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF +!define PROCESSOR_ARCHITECTURE_INTEL 0 ; x86 +!define PROCESSOR_ARCHITECTURE_ARM 5 +!define PROCESSOR_ARCHITECTURE_IA64 6 ; Itanium +!define PROCESSOR_ARCHITECTURE_AMD64 9 ; x86-64/x64 +!define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 10 +!define PROCESSOR_ARCHITECTURE_ARM64 12 +!define PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64 13 !endif /* __WIN_NOINC_WINNT */ !verbose pop diff --git a/Include/x64.nsh b/Include/x64.nsh index e66fb859..eeddca8e 100644 --- a/Include/x64.nsh +++ b/Include/x64.nsh @@ -47,6 +47,23 @@ !macroend +!define GetNativeProcessorArchitecture "!insertmacro GetNativeProcessorArchitecture " +!macro GetNativeProcessorArchitecture outvar + !if ${outvar} != $1 + Push $1 + !endif + !if "${NSIS_PTR_SIZE}" <= 4 + System::Call 'KERNEL32::GetSystemInfo(@r1)' ; < XP + !endif + System::Call 'KERNEL32::GetNativeSystemInfo(@r1)' + System::Call '*$1(&i2.s)' ; Extract wProcessorArchitecture (PROCESSOR_ARCHITECTURE_*) + Pop ${outvar} + !if ${outvar} != $1 + Pop $1 + !endif +!macroend + + !define DisableX64FSRedirection "!insertmacro DisableX64FSRedirection" !macro DisableX64FSRedirection System::Call kernel32::Wow64EnableWow64FsRedirection(i0)