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
This commit is contained in:
anders_k 2018-02-01 21:34:37 +00:00
parent 0b01a969e4
commit 696a317eca
3 changed files with 33 additions and 0 deletions

View file

@ -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

View file

@ -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

View file

@ -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)