2006-09-23 08:16:28 +00:00
|
|
|
; ---------------------
|
|
|
|
; x64.nsh
|
|
|
|
; ---------------------
|
|
|
|
;
|
|
|
|
; A few simple macros to handle installations on x64 machines.
|
|
|
|
;
|
2014-08-15 20:25:18 +00:00
|
|
|
; RunningX64 checks if the installer is running on a 64-bit OS.
|
|
|
|
; IsWow64 checks if the installer is a 32-bit application running on a 64-bit OS.
|
2006-09-23 08:16:28 +00:00
|
|
|
;
|
2006-09-29 16:15:50 +00:00
|
|
|
; ${If} ${RunningX64}
|
2006-09-23 08:16:28 +00:00
|
|
|
; MessageBox MB_OK "running on x64"
|
|
|
|
; ${EndIf}
|
|
|
|
;
|
|
|
|
; DisableX64FSRedirection disables file system redirection.
|
|
|
|
; EnableX64FSRedirection enables file system redirection.
|
|
|
|
;
|
2007-01-23 19:35:48 +00:00
|
|
|
; SetOutPath $SYSDIR
|
2006-09-23 08:16:28 +00:00
|
|
|
; ${DisableX64FSRedirection}
|
2007-01-23 19:35:48 +00:00
|
|
|
; File some.dll # extracts to C:\Windows\System32
|
2006-09-23 08:16:28 +00:00
|
|
|
; ${EnableX64FSRedirection}
|
2007-01-23 19:35:48 +00:00
|
|
|
; File some.dll # extracts to C:\Windows\SysWOW64
|
2006-09-23 08:16:28 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
!ifndef ___X64__NSH___
|
|
|
|
!define ___X64__NSH___
|
|
|
|
|
2006-09-29 16:15:50 +00:00
|
|
|
!include LogicLib.nsh
|
2006-09-23 08:16:28 +00:00
|
|
|
|
2014-08-15 20:25:18 +00:00
|
|
|
|
|
|
|
!define IsWow64 `"" IsWow64 ""`
|
|
|
|
!macro _IsWow64 _a _b _t _f
|
2006-09-29 16:15:50 +00:00
|
|
|
!insertmacro _LOGICLIB_TEMP
|
2013-09-06 23:48:59 +00:00
|
|
|
System::Call kernel32::GetCurrentProcess()p.s
|
2014-08-15 20:25:18 +00:00
|
|
|
System::Call kernel32::IsWow64Process(ps,*i0s)
|
2006-09-29 16:15:50 +00:00
|
|
|
Pop $_LOGICLIB_TEMP
|
|
|
|
!insertmacro _!= $_LOGICLIB_TEMP 0 `${_t}` `${_f}`
|
2006-09-23 08:16:28 +00:00
|
|
|
!macroend
|
|
|
|
|
2014-08-15 20:25:18 +00:00
|
|
|
|
2006-09-29 16:15:50 +00:00
|
|
|
!define RunningX64 `"" RunningX64 ""`
|
2014-08-15 20:25:18 +00:00
|
|
|
!macro _RunningX64 _a _b _t _f
|
|
|
|
!if ${NSIS_PTR_SIZE} > 4
|
|
|
|
!insertmacro LogicLib_JumpToBranch `${_t}` `${_f}`
|
|
|
|
!else
|
|
|
|
!insertmacro _IsWow64 `${_a}` `${_b}` `${_t}` `${_f}`
|
|
|
|
!endif
|
|
|
|
!macroend
|
2006-09-23 08:16:28 +00:00
|
|
|
|
|
|
|
|
2018-02-01 21:34:37 +00:00
|
|
|
!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
|
|
|
|
|
2018-04-08 21:58:25 +00:00
|
|
|
!define IsNativeProcessorArchitecture `"" IsNativeProcessorArchitecture `
|
|
|
|
!macro _IsNativeProcessorArchitecture _ignore _arc _t _f
|
|
|
|
!insertmacro _LOGICLIB_TEMP
|
|
|
|
${GetNativeProcessorArchitecture} $_LOGICLIB_TEMP
|
|
|
|
!insertmacro _= $_LOGICLIB_TEMP ${_arc} `${_t}` `${_f}`
|
|
|
|
!macroend
|
|
|
|
!define IsNativeProcessorArchitectureIA32 '${IsNativeProcessorArchitecture} 0' ; Intel x86
|
|
|
|
!define IsNativeProcessorArchitectureAMD64 '${IsNativeProcessorArchitecture} 9' ; x86-64/x64
|
|
|
|
!define IsNativeProcessorArchitectureARM64 '${IsNativeProcessorArchitecture} 12'
|
|
|
|
|
2018-02-01 21:34:37 +00:00
|
|
|
|
2014-08-15 20:25:18 +00:00
|
|
|
!define DisableX64FSRedirection "!insertmacro DisableX64FSRedirection"
|
|
|
|
!macro DisableX64FSRedirection
|
2006-09-23 08:16:28 +00:00
|
|
|
System::Call kernel32::Wow64EnableWow64FsRedirection(i0)
|
|
|
|
!macroend
|
|
|
|
|
2014-08-15 20:25:18 +00:00
|
|
|
!define EnableX64FSRedirection "!insertmacro EnableX64FSRedirection"
|
2006-09-23 08:16:28 +00:00
|
|
|
!macro EnableX64FSRedirection
|
|
|
|
System::Call kernel32::Wow64EnableWow64FsRedirection(i1)
|
|
|
|
!macroend
|
|
|
|
|
|
|
|
|
|
|
|
!endif # !___X64__NSH___
|