Archive: Check architecture (x86, x64 or ia64)


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.


shamelessly copied from:
http://forums.winamp.com/showthread.php?threadid=299034


!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

Perfect, thank you sir!