x64.nsh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ; ---------------------
  2. ; x64.nsh
  3. ; ---------------------
  4. ;
  5. ; A few simple macros to handle installations on x64 machines.
  6. ;
  7. ; RunningX64 checks if the installer is running on x64.
  8. ;
  9. ; ${If} ${RunningX64}
  10. ; MessageBox MB_OK "running on x64"
  11. ; ${EndIf}
  12. ;
  13. ; DisableX64FSRedirection disables file system redirection.
  14. ; EnableX64FSRedirection enables file system redirection.
  15. ;
  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
  21. ;
  22. !ifndef ___X64__NSH___
  23. !define ___X64__NSH___
  24. !include LogicLib.nsh
  25. !macro _RunningX64 _a _b _t _f
  26. !insertmacro _LOGICLIB_TEMP
  27. System::Call kernel32::GetCurrentProcess()i.s
  28. System::Call kernel32::IsWow64Process(is,*i.s)
  29. Pop $_LOGICLIB_TEMP
  30. !insertmacro _!= $_LOGICLIB_TEMP 0 `${_t}` `${_f}`
  31. !macroend
  32. !define RunningX64 `"" RunningX64 ""`
  33. !macro DisableX64FSRedirection
  34. System::Call kernel32::Wow64EnableWow64FsRedirection(i0)
  35. !macroend
  36. !define DisableX64FSRedirection "!insertmacro DisableX64FSRedirection"
  37. !macro EnableX64FSRedirection
  38. System::Call kernel32::Wow64EnableWow64FsRedirection(i1)
  39. !macroend
  40. !define EnableX64FSRedirection "!insertmacro EnableX64FSRedirection"
  41. !endif # !___X64__NSH___