Skip to content
⌘ NSIS Forum Archive

Check architecture (x86, x64 or ia64)

3 posts

werrock#

Check architecture (x86, x64 or ia64)

How can you check what CPU architecture you are running on. Need it to select the correct vc9 re distributable.
Animaether#
shamelessly copied from:
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.



!include WinVer.nsh
${If} ${AtLeastWinXP}
System::Alloc 36
pop $0
${If} $0 <> 0
System::Call 'kernel32::GetNativeSystemInfo(i $0)'
System::Call "*$0(&i2.r1)"
MessageBox mb_ok wProcessorArchitecture=$1
System::Free $0
${EndIf}
${EndIf}
$1 in that code will be one of:
0: x86
6: ia64
9: x64
0xffff: unknown