macho: Improve macho_calculate_sizes
[nasm.git] / nsis / x64.nsh
blobe694c1e61369381f31fc1e31fe5fb7b9ad70e8d1
1 ; ---------------------
2 ;       x64.nsh
3 ; ---------------------
5 ; A few simple macros to handle installations on x64 machines.
7 ; RunningX64 checks if the installer is running on x64.
9 ;   ${If} ${RunningX64}
10 ;     MessageBox MB_OK "running on x64"
11 ;   ${EndIf}
13 ; DisableX64FSRedirection disables file system redirection.
14 ; EnableX64FSRedirection enables file system redirection.
16 ;   SetOutPath $SYSDIR
17 ;   ${DisableX64FSRedirection}
18 ;   File some.dll # extracts to C:\Windows\System32
19 ;   ${EnableX64FSRedirection}
20 ;   File some.dll # extracts to C:\Windows\SysWOW64
23 !ifndef ___X64__NSH___
24 !define ___X64__NSH___
26 !include LogicLib.nsh
28 !macro _RunningX64 _a _b _t _f
29   !insertmacro _LOGICLIB_TEMP
30   System::Call kernel32::GetCurrentProcess()i.s
31   System::Call kernel32::IsWow64Process(is,*i.s)
32   Pop $_LOGICLIB_TEMP
33   !insertmacro _!= $_LOGICLIB_TEMP 0 `${_t}` `${_f}`
34 !macroend
36 !define RunningX64 `"" RunningX64 ""`
38 !macro DisableX64FSRedirection
40   System::Call kernel32::Wow64EnableWow64FsRedirection(i0)
42 !macroend
44 !define DisableX64FSRedirection "!insertmacro DisableX64FSRedirection"
46 !macro EnableX64FSRedirection
48   System::Call kernel32::Wow64EnableWow64FsRedirection(i1)
50 !macroend
52 !define EnableX64FSRedirection "!insertmacro EnableX64FSRedirection"
54 !endif # !___X64__NSH___