Re: How to get the Mac OS X version?
Re: How to get the Mac OS X version?
- Subject: Re: How to get the Mac OS X version?
- From: Finlay Dobbie <email@hidden>
- Date: Sat, 8 Sep 2001 12:32:37 +0100
NSDictionary *systemVersion = [NSDictionary
dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.
plist"];
You can then use the keys ProductBuildVersion and ProductVersion to
return the build number (e.g. 4Q12) and other version number (e.g.
10.0.4). I personally do this:
if (![[systemVersion objectForKey:@"ProductVersion"]
isEqualToString:@"10.0.4"]) {
int retVal = NSRunAlertPanel(@"Incompatible system?",@"You do
not appear to be running Mac OS X 10.0.4. This product has only been
tested on Mac OS X 10.0.4.\n\nIf you are using a version prior to
10.0.4, this product will probably work, but you should update to 10.0.4
anyway.\n\nIf you are using a version of Mac OS X later than 10.0.4,
then please check back to the web site at
http://osx.hotlinex.org/ for
an updated version.",@"Continue anyway",@"Quit",nil);
if (retVal != NSAlertDefaultReturn)
[NSApp terminate:self];
}
(because my product installs a System Preferences pane, which only works
on 10.0.x (the API changed on 10.1, as did the bundle configuration).
-- Finlay
On Thursday, January 1, 1970, at 05:03 am, steg wrote:
How to get the version of the system? any idea?
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev