Archive: How to detect if system is 32bit or 64bit


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.


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

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}

Keep in mind that GetVersion::WindowsPlatformArchitecture requires the GetVersion plugin, which doesn't ship with NSIS.
http://nsis.sourceforge.net/GetVersi...ows%29_plug-in

Overall I'd say use x64.nsh (and WinVer.nsh for other windows version bits checking) before poking at the plugin.


Also, please stop reviving age-old threads...


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