macOS app has inaccurate version information
vitorgalvao opened this issue · 3 comments
To accurately display version information, macOS apps need to have the CFBundleVersion
and CFBundleShortVersionString
tags in Info.plist
.
In Flying Carpet’s case, the latter is set to a fixed 1.0.0
while the former is not present.
If they’re not set during the build process, they can be added after it’s done by directly editing the Info.plist
:
# Change these values
app_path='/PATH/TO/APP/HERE'
app_version='VERSION NUMBER HERE'
# Keep these as they are
/usr/libexec/PlistBuddy -c "Add :CFBundleVersion string ${app_version}" "${app_path}/Contents/Info.plist" # Adds the missing value
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString string ${app_version}" "${app_path}/Contents/Info.plist" # Modifies the existing value
That would use the same version number for both fields. Technically they should be different, but that’s a secondary concern. An accurate version number is important for macOS to know which app to open in ambiguous situations; for users who expect the information available via the Finder; and for interoperability with other apps.
Ok thanks, probably be next week sometime but I'll fix.
@vitorgalvao I updated CFBundleShortVersionString and added CFBundleVersion and updated the Mac 4.1 binary on the releases page. What's the easiest way to check that value in macOS?
What's the easiest way to check that value in macOS?
# Change this value
app_path='/PATH/TO/APP/HERE'
# Keep these as they are
for version in {CFBundleVersion,CFBundleShortVersionString}; do
echo -n "${version}: "
/usr/libexec/PlistBuddy -c "Print :${version}" "${app_path}/Contents/Info.plist"
done
That would return:
CFBundleVersion: 4.1
CFBundleShortVersionString: 4.1