summaryrefslogtreecommitdiff
path: root/nsis
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2016-10-23 16:24:10 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2016-10-23 16:27:44 +0300
commit9e8c2466a4eaa3de7d25ea46257ba9b0af45b671 (patch)
tree9bb491d040a48f9a2e59947004e38713c05d332d /nsis
parentf5287231c16d4d69e67f7ee36506633024e27022 (diff)
downloadnasm-9e8c2466a4eaa3de7d25ea46257ba9b0af45b671.tar.gz
nsis: Import x64.nsh
From NSIS-3.0 source code (Include/x64.nsh). Hopefully it will be enough for nsis-v2.5 to support Win64. https://sourceforge.net/p/nsis/code/HEAD/tree/NSIS/trunk/Include/x64.nsh Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'nsis')
-rw-r--r--nsis/x64.nsh54
1 files changed, 54 insertions, 0 deletions
diff --git a/nsis/x64.nsh b/nsis/x64.nsh
new file mode 100644
index 00000000..e694c1e6
--- /dev/null
+++ b/nsis/x64.nsh
@@ -0,0 +1,54 @@
+; ---------------------
+; x64.nsh
+; ---------------------
+;
+; A few simple macros to handle installations on x64 machines.
+;
+; RunningX64 checks if the installer is running on x64.
+;
+; ${If} ${RunningX64}
+; MessageBox MB_OK "running on x64"
+; ${EndIf}
+;
+; DisableX64FSRedirection disables file system redirection.
+; EnableX64FSRedirection enables file system redirection.
+;
+; SetOutPath $SYSDIR
+; ${DisableX64FSRedirection}
+; File some.dll # extracts to C:\Windows\System32
+; ${EnableX64FSRedirection}
+; File some.dll # extracts to C:\Windows\SysWOW64
+;
+
+!ifndef ___X64__NSH___
+!define ___X64__NSH___
+
+!include LogicLib.nsh
+
+!macro _RunningX64 _a _b _t _f
+ !insertmacro _LOGICLIB_TEMP
+ System::Call kernel32::GetCurrentProcess()i.s
+ System::Call kernel32::IsWow64Process(is,*i.s)
+ Pop $_LOGICLIB_TEMP
+ !insertmacro _!= $_LOGICLIB_TEMP 0 `${_t}` `${_f}`
+!macroend
+
+!define RunningX64 `"" RunningX64 ""`
+
+!macro DisableX64FSRedirection
+
+ System::Call kernel32::Wow64EnableWow64FsRedirection(i0)
+
+!macroend
+
+!define DisableX64FSRedirection "!insertmacro DisableX64FSRedirection"
+
+!macro EnableX64FSRedirection
+
+ System::Call kernel32::Wow64EnableWow64FsRedirection(i1)
+
+!macroend
+
+!define EnableX64FSRedirection "!insertmacro EnableX64FSRedirection"
+
+!endif # !___X64__NSH___