From 11d465de96284056a4a53e21c6da792eb6c66cc8 Mon Sep 17 00:00:00 2001 From: kichik Date: Sat, 23 Sep 2006 08:16:28 +0000 Subject: [PATCH] macros for x64 installations handling git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4756 212acab6-be3b-0410-9dea-997c60f758d6 --- Include/SConscript | 1 + Include/x64.nsh | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 Include/x64.nsh diff --git a/Include/SConscript b/Include/SConscript index c187435a..aee76da4 100644 --- a/Include/SConscript +++ b/Include/SConscript @@ -10,6 +10,7 @@ includes = Split(""" UpgradeDLL.nsh WinMessages.nsh WordFunc.nsh + x64.nsh """) Import('env') diff --git a/Include/x64.nsh b/Include/x64.nsh new file mode 100644 index 00000000..d3ee7623 --- /dev/null +++ b/Include/x64.nsh @@ -0,0 +1,52 @@ +; --------------------- +; x64.nsh +; --------------------- +; +; A few simple macros to handle installations on x64 machines. +; +; IsRunningX64 checks if the installers is running on x64. +; +; ${IsRunningX64} +; Pop $0 +; ${If} $0 != 0 +; MessageBox MB_OK "running on x64" +; ${EndIf} +; +; DisableX64FSRedirection disables file system redirection. +; EnableX64FSRedirection enables file system redirection. +; +; ${DisableX64FSRedirection} +; DetailPrint $SYSDIR # prints C:\Windows\System32 +; ${EnableX64FSRedirection} +; DetailPrint $SYSDIR # prints C:\Windows\SysWOW64 +; + +!ifndef ___X64__NSH___ +!define ___X64__NSH___ + +!macro IsRunningX64 + + System::Call kernel32::GetCurrentProcess()i.s + System::Call kernel32::IsWow64Process(is,*i.s) + +!macroend + +!define IsRunningX64 "!insertmacro IsRunningX64" + +!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___