Re: Gracefully failing on unsupported OS version
Re: Gracefully failing on unsupported OS version
- Subject: Re: Gracefully failing on unsupported OS version
- From: Ricky Sharp <email@hidden>
- Date: Mon, 18 Apr 2005 13:04:11 -0500
On Monday, April 18, 2005, at 12:45PM, John Brownlow <email@hidden> wrote:
>My app is targeted at 10.4 and better. I know that whatever I do,
>people are going to download it and try to use it on earlier versions.
>I don't want to use an installer, just the drag-to-Applications thing.
>However, as currently configured, on pre-10.4 systems the app just
>fails to launch without a word of explanation. The syslog shows that
>the cause of the crash is "failed objc_getClass(NS**tigerOnlyClass**)"
>
>What's the nicest way of catching this problem without using an
>installer? If the app won't launch in, say, 10.3, how can I tell the
>user very politely that they need to upgrade if they want to use my
>app?
One method is by adding the LSMinimumSystemVersion key to your Info.plist. As an example, look at Safari's Info.plist file.
However, I don't think 10.3.x and earlier all handle this key the same way.
The only other thing I can think of is to ensure that all the OS-specific code you may have would not be invoked at startup (this may not be possible though). Basically, your startup logic is OS-neutral. You then query the OS and do the right thing (i.e. show the 'update message' or continue your app's startup.
Doing this in Cocoa definitely seems to be difficult. Back in the old days, I remember creating FAT apps where a PowerPC was ultimately required. The 68K portion was just simple code to fire up a 'This app requires a PowerPC' alert. In Classic/Carbon, you could pretty much just query the OS at startup before you did anything else. This could also be problematic as you'd have to be careful of calling into non-existing APIs during static initialize time.
Maybe it's time for an enhancement request. The dialog that is displayed by Launch Services when LSMinimumSystemVersion isn't met could perhaps display a link to your product's web site (a new 'web site' key in your Info.plist).
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
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