Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Launch Services and CFBundleVersion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Launch Services and CFBundleVersion



The documentation has an important caveat which should be noted:

This string is usually of the form

The operative word in this case being "usually." It's difficult to code to this spec.


I can tell you that when comparing version numbers for document binding purposes, Launch Services respects the first three version components, but IGNORES the development stage code (a, b, d, etc.) and anything following it.

It's true that many instances of CFBundleVersion values do not conform to the requirements of CFBundleGetVersionNumber(). Internally, Launch Services is more flexible in recognition of Info.plist reality. Effectively, LS expects the following format: nnnnn[.nn[.nn]][X] where n is a digit 0-9, square brackets indicate optional components, and X is any string not starting with a digit. X is ignored when present.

-Chris

On Jun 7, 2006, at 12:59 PM, Dave Dribin wrote:

Hello,

I would like to know Launch Services determines which version of my application to run, if there are multiple version on the disk. From what I can tell, Launch Services uses CFBundleVersion to do this. However, CFBundleVersion, is described here:

<http://developer.apple.com/documentation/MacOSX/Conceptual/ BPRuntimeConfig/Articles/PListKeys.html#//apple_ref/doc/uid/ 20001431-102364>

It states the format is "nn.n.nxnnn" where the second and third digits must be a single numeric digit, i.e. 0-9. After reading Technote TN1132 [1], I assume this is due to the BCD usage within the old NumVersion struct. However, does this restriction still apply today with Launch Services? Can I really not have a "1.0.15" version?

From some investigation, it seems Launch Services does not strictly interpret CFBundleVersion as a NumVersion struct. In fact, some of Apple's own apps violate the "nn.n.nxnnn" format, such as Mail.app, which has an CFBundleVersion of "746.2".

So I guess my questions boil down to: How does Launch Services interpret CFBundleVersion, and how should I use it in my app? Should I just use an increasing floating point number like Mail.app? Or should I follow the TN1132 versioning system, assuming the BCD restrictions no longer apply? Or will either work, so long as I am consistent between versions?

Thanks,

-Dave

[1] http://developer.apple.com/technotes/tn/tn1132.html

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Launch Services and CFBundleVersion (From: Dave Dribin <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.