Skip to content
⌘ NSIS Forum Archive

How to detect if system is 32bit or 64bit

6 posts

rybz#

How to detect if system is 32bit or 64bit

How to detect in NSIS in a simple way if system is 32bit or 64bit? Thanks for any hints.
Zinthose#
Try searching next time...

!include x64.nsh

outfile test.exe

Section Test
${If} ${RunningX64}
MessageBox MB_OK "running on x64"
${Else}
MessageBox MB_OK "running on x86"
${EndIf}
SectionEnd
Deko Servidoni#
You can try this too:


GetVersion::WindowsPlatformArchitecture
Pop $R1

${If} $R1 == "32"
MessageBox MB_OK "32 bits"
${ElseIf} $R1 == "64"
MessageBox MB_OK "64 bits"
${Endif}
Animaether#
Keep in mind that GetVersion::WindowsPlatformArchitecture requires the GetVersion plugin, which doesn't ship with NSIS.


Overall I'd say use x64.nsh (and WinVer.nsh for other windows version bits checking) before poking at the plugin.
jiake#
see: http://forums.winamp.com/showpost.ph...27&postcount=4

System::Call "kernel32::GetCurrentProcess() i .s"
System::Call "kernel32::IsWow64Process(i s, *i .r0)"
StrCmp $0 "0" is32bit is64bit