Re: NSAppKitVersionNumber for 10.3.0?
Re: NSAppKitVersionNumber for 10.3.0?
- Subject: Re: NSAppKitVersionNumber for 10.3.0?
- From: Rainer Brockerhoff <email@hidden>
- Date: Mon, 20 Sep 2004 08:15:08 -0300
At 00:06 -0700 20/09/2004, email@hidden wrote:
>From: Jim Correia <email@hidden>
>
>On Sep 19, 2004, at 8:19 PM, Sean McBride wrote:
>
>>George Lawrence Storm (email@hidden) on Fri, Sep 17, 200412:
>>05 said:
>>
>>>>The LSMinimumSystemVersion key may be useful to you too.
>>>
>>>I just tried it, the only problem is that the program does not launch
>>>(correct) however the system does not warn the user (baaad Apple, no
>>>cookie).
>>
>>I just read about it recently so confess to never trying it before
>>mentioning it to you. I can confirm that it just quits silently on my
>>system too, rather pathetic I dare say.
>
>It works correctly on 10.2. I have filed a bug. If this affects yourproduct, you should file a bug as well. It will be closed as aduplicate, but it will let Apple know how widespread the problem is.
AFAIK 10.1.x ignores LSMinimumSystemVersion, 10.2.x quits with a message, and 10.3.x quits without a message. So to be safe I write:
#import <Carbon/Carbon.h>
int main(int argc, char *argv[]) {
SInt32 MacVersion = 0;
Gestalt(gestaltSystemVersion, &MacVersion);
if (MacVersion<0x1030) {
DialogRef alert = NULL;
OSStatus err = CreateStandardAlert(kAlertStopAlert,
CFSTR("Unsupported System Version"),
CFSTR("Sorry, but you need Mac OS X 10.3 (or greater) to run this application!"),NULL,&alert);
if (err==noErr) {
DialogItemIndex item = 0;
err = RunStandardAlert(alert, NULL, &item);
}
return 1;
}
return NSApplicationMain(argc,(const char**)argv);
}
...with the added bonus that you can write your own apologetic/snippy/obscure message ;-)
--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"It's extremely unlucky to be superstitious, for no other reason
than it is always unlucky to be colossally stupid." (Stephen Fry)
Weblog: http://www.brockerhoff.net/bb/viewtopic.php
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden