Identify 32bit & 64bit OS

Comments

1 comment

  • Avatar
    wojciechka

    This depends on operating system. For Windows, you can simply use a <platformTest> rule against windows-x86 and windows-x64. For example:

    <actionGroup> <actionList> <!-- ... --> </actionList> <ruleList> <platformTest type="windows-x86"/> </ruleList> </actionGroup> <actionGroup> <actionList> <!-- ... --> </actionList> <ruleList> <platformTest type="windows-x64"/> </ruleList> </actionGroup>

    For Linux, the test can be against linux-x64 to check if the machine is 64-bit and negated test for linux-x64 detects that it is a Linux 32-bit machine. For example:

    <actionGroup> <actionList> <!-- ... --> </actionList> <ruleList> <platformTest type="linux"/> <platformTest type="linux-x64" negate="1" /> </ruleList> </actionGroup> <actionGroup> <actionList> <!-- ... --> </actionList> <ruleList> <platformTest type="linux-x64"/> </ruleList> </actionGroup>

    For OS X, the issue is more complex as you may want to detect if kernel is 64bit or if CPU supports 64bit, as OS X running in 32bit mode can run 64bit binaries. As this is a more complex issue, there is currently no option to check it using <platformTest>.

Please sign in to leave a comment.