View Full Version : Detecting system type?  Jul 9, 2012, 10:22
PM What's the best way for an App to figure out what machine and
version it's running on? For instance, if you wanted to make a
program only have a certain feature if it's running on a Mac
Mini.  Jul 9, 2012, 10:36 PM It depends on exactly how you want
to qualify "machine" and "version".  For the specific case of "a
Mac mini", I would probably use the sysctl name "hw.model",
which in the case of a Mac mini would return a C string like
"Macmini1,1" or "Macmini2,1". Because all models of Mac mini
(well Intel-based) have the string "Macmini", that's what I'd
look for. Specific models over time have different "n,m" values,
so if that's what you mean by "version", then use that.
Otherwise you'll have to describe exactly what "version"
represents.  If I had to qualify PowerPC-based Mac minis, I'm
not sure if sysctl hw.model would work or not, I'd have to test
it first.  There are a lot of other hardware qualifiers in the
"hw" family of sysctl names. See