a code example with autoit do this
Code: Select all
If @OSArch = "x86" Then
MsgBox(0,"", "Your Operating System x86")
Else
MsgBox(0,"", "Your Operating System x64")
EndIf
Code: Select all
If @OSArch = "x86" Then
MsgBox(0,"", "Your Operating System x86")
Else
MsgBox(0,"", "Your Operating System x64")
EndIf
Yes -> viewtopic.php?p=256374#p256374mRbrS wrote:Is there a short example of this in Purebasic?
Does not works for Linux (Ligne 6: Structure not found: SYSTEM_INFO.)Is there a short example of this in Purebasic?
Yes -> viewtopic.php?p=256374#p256374
Returns 1 on a 64bit OS, or 0 on a 32bit OS.
Code: Select all
If GetEnvironmentVariable("ProgramFiles(x86)") = ""
MessageRequester("Info", "Windows 32 bits")
Else
MessageRequester("Info", "Windows 64 bits")
EndIf
Code: Select all
GetEnvironmentVariable("HOSSTYPE")
Code: Select all
# echo $HOSTTYPE
X86_64
No,Tenaja wrote:Check the size of type int.
Nevermind, that's just for your program. Some 64 bit os's allow running 32 bit programs.
Code: Select all
Procedure GetProcessorArchitechture()
If GetEnvironmentVariable("PROCESSOR_ARCHITEW6432") = "AMD64" : ProcedureReturn 64 ; OS is 64-Bit, but program is 32-Bit
ElseIf GetEnvironmentVariable("PROCESSOR_ARCHITECTURE") = "AMD64" : ProcedureReturn 64 ; OS and program are both 64-Bit
ElseIf GetEnvironmentVariable("PROCESSOR_ARCHITECTURE") = "x86" : ProcedureReturn 32 ; both are 32-Bit
EndIf ; return 0, if failed
EndProcedure
Code: Select all
Debug Right(GetEnvironmentVariable("PROCESSOR_ARCHITECTURE"), 2) ; 64