Proper Version number in Info.plist

I notice that my apps, when they crash, show version info like this:

Identifier:            com.mycopmany.myApp
Version:               1.2.3 (1.2.3)

Whereas other apps show the build number

Identifier:            com.apple.iCal
Version:               8.0 (2034.9)

Naturally, I like the second variation as it gives more information.

However, when I get-Info on my app in the finder, it shows more info, e.g.:

MyApp
Version 1.2.3

whereas Apple’s apps only show 2 digits.

iCal
Version 8.0

In this case, I prefer the way my app does it .

There seem to be a lot of options:

CFBundleVersion   (Apple's apps seem to use this for the build # version)
CFBundleGetInfoString  (Apple's apps don't use this, but mine does)
CFBundleShortVersionString (My app has 3 digits here (1.2.3), Apple's app uses only 2 (8.0)

Can we have the best of both worlds? I’d like the Finder to show the 3 (or 4?) digit version number, and I’d like crash logs to show the build # version as well.

Documentation seems inconsistent, too:

For CFBundleVersion apple says

[quote]CFBundleVersion (String - iOS, OS X) specifies the build version number of the bundle, which identifies an iteration (released or unreleased) of the bundle. The build version number should be a string comprised of three non-negative, period-separated integers with the first integer being greater than zero. The string should only contain numeric (0-9) and period (.) characters. Leading zeros are truncated from each integer and will be ignored (that is, 1.02.3 is equivalent to 1.2.3). This key is not localizable.
[/quote]

And yet in Apple’s own apps, CFBundleVersion has a value such as “2034.9”

See https://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-102364-TPXREF106

Welcome to our world trying to write them correctly from the IDE based on Apple’s docs :slight_smile:

In App Wrapper there’s a setting for altering the Xojo version number to match Apple’s suggested format.

The one they recommend, or the one they actually use? :slight_smile:

Anyway, I think I found a solution that’s not half bad:

  CFBundleVersion = the build # (e.g. the 4th digit of A.B.C.D) - what Xojo calls the "non release" number
  CFBundleShortVersionString = the first 3 digits, e.g. "A.B.C"
  NSHumanReadableCopyright : this can have the full 4 digit string in it, e.g. "Version A.B.C.D Copyright © my company"

This allows one to get the full version number using Finder/Get Info, and in theory it should also provide the build # in a crashlog report (yet to be tested).

Here’s an example;