• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSAppKitVersionNumber for 10.3.0?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSAppKitVersionNumber for 10.3.0?
      • From: Jim Correia <email@hidden>
  • Prev by Date: Resampling/resizing pictures (solved but why ?)
  • Next by Date: Re: transformers? revisited but getting there..
  • Previous by thread: Re: NSAppKitVersionNumber for 10.3.0?
  • Next by thread: Re: NSAppKitVersionNumber for 10.3.0?
  • Index(es):
    • Date
    • Thread