summaryrefslogtreecommitdiff
path: root/scripts/x64.nsh
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-05-25 19:21:17 (GMT)
committerMarius Kintel <marius@kintel.net>2013-05-25 19:21:17 (GMT)
commit9740232b080ac3d2fe87309fb51a892faf6ea913 (patch)
tree974ac256413de1111a085d12cad7bc3f755792dd /scripts/x64.nsh
parentfef8dba56bae76f6e876656cee603fc895fa0955 (diff)
parente60744776193d5dc3f22e7a4a9f3afa8b8664e30 (diff)
Merge branch 'master' into issue364
Diffstat (limited to 'scripts/x64.nsh')
-rw-r--r--scripts/x64.nsh54
1 files changed, 54 insertions, 0 deletions
diff --git a/scripts/x64.nsh b/scripts/x64.nsh
new file mode 100644
index 0000000..e694c1e
--- /dev/null
+++ b/scripts/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___
contact: Jan Huwald // Impressum