On Sep 18, 2006, at 9:16 AM, Dan Smith wrote:

Our installer application is written in RB. It turns out that it needs to install slightly different things depending on whether it is installing on an Intel-architecture or PPC-architecture Mac.

The installer application runs fine under Rosetta, so for us there's no urgency at all about universal-binary-target version of RB.

What would people suggest as the least kludgey, most respectable, most robust way for a PPC application to determine whether it is running on a PPC platform, or on an Intel platform (using Rosetta)?

(It would actually be acceptable for the installer to ask the _user_ via a dialog box to indicate the platform architecture... or to provide separate installers named "Install on Intel-Core Mac" and "Install on G5 Mac..." so that's the fallback. But I'd like to detect the architecture automatically if possible).

Once the RB app is UB, then it should be as easy as testing "TargetBigEndian" (for PPC). The problem is that for right now a Rosetta app will return true for TargetBigEndian even on Intel CPUs.

However, there appears to be a way using System.Gestalt("sysa", sysValue):

enum {
   gestaltSysArchitecture = 'sysa',
   gestalt68k = 1,
   gestaltPowerPC = 2,
   gestaltIntel = 10
};

source:
http://developer.apple.com/documentation/Carbon/Reference/ Gestalt_Manager/Reference/reference.html#//apple_ref/c/econst/ gestaltSysArchitecture

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to