Archive: Detect 64-Bit OS


Detect 64-Bit OS
Hello world,

what is the "standard" (recommended) way to query if my installer is running on a 64-bit OS (like WinXP-64 or Vista-64)?

a) Is ${If} ${RunningX64} from x64.nsh meant for this purpose (or does it detect x64 CPU hardware instead)?

b) Can I combine WinVer.nsh with x64.nsh like that:

${If} ${IsWinXP}
${If} ${RunningX64}
DetailPrint "Windows XP 64-bit"
${Else}
DetailPrint "Windows XP 32-bit"
${EndIf}
${ElseIf} ${IsWinVista}
${If} ${RunningX64}
DetailPrint "Windows Vista 64-bit"
${Else}
DetailPrint "Windows Vista 32-bit"
${EndIf}
${ElseIf} ${RunningX64}
DetailPrint "Any other 64-bit OS"
${Else}
DetailPrint "Any other 32-bit OS"
${EndIf}
Or won't this code work as I expect?

RunningX64 is exactly for this purpose.

If you want to combine it with WinVer.nsh, make sure you're using the latest version so Windows XP x64 won't be identified as 2003.