Archive: How tell if the target is a 64-bit or not


How tell if the target is a 64-bit or not
  Is there some way to create a script that tells whether the target computer is a 64-bit computer, and if it is, do some action that would not be done if it were a 32-bit machine?

Thanks in advance.


NSIS\Include\x64.nsh. Have you even *tried* searching? o_O


read help file chapter "4.2.3 Constants"


  ;Var BITVERSION

;Var ERROR
;32/64bit
;Call bitversion
;StrCmp $ERROR "1" jump_error
>Function bitversion
GetVersion
::WindowsPlatformArchitecture
Pop $BITVERSION
StrCmp $BITVERSION"64" bit64
StrCmp $BITVERSION"32" 0 error
;bit32:
SetRegView 32
Sleep 500
Goto done
bit64:
;disable registry redirection (enable access to 64-bit portion of registry)
SetRegView 64
Sleep 500
Goto done
error:
StrCpy $ERROR "1"
done:
;messagebox mb_ok "'$BITVERSION'"
>FunctionEnd
>

You don't need to use GetVersion for this, just use x64.nsh as MSG pointed out.

${If} ${RunningX64}
...
${Else}
...
Stu

well, actually i am working with that flag in $vars$bitversion instead logiclib


Can't believe I completely forgot about x64.nsh.:weird: