Docu
Docu

Reputation: 147

Detecting windows 32bit or 64 bit using NSIS

I'm trying to determine which arquitecture has the OS. I'm using this code:

!include x64.nsh

${If} ${RunningX64}
    # 64 bit code
${Else}
    # 32 bit code
${EndIf}     

But always enters to #32 bit code in spite of I'm executing it on W7 x64 OS.

Upvotes: 0

Views: 2219

Answers (1)

Anders
Anders

Reputation: 101764

Try running this:

DetailPrint "NSIS=${NSIS_VERSION}"
System::Call 'kernel32::GetCurrentProcess()i.r0'
DetailPrint "GetCurrentProcess=$0"
System::Call 'kernel32::IsWow64Process(ir0,*i.r1)i.r2?e'
pop $3
DetailPrint "IsWow64Process: ret=$2 gle=$3 result=$1"

On my Win8 x64 OS this gives me:

NSIS=v2.46
GetCurrentProcess=-1 
IsWow64Process: ret=1 gle=80 result=1

Upvotes: 1

Related Questions