EA to report CFBundleVersion for Safari now that Apple is repeatedly re-using the same version #

sdagley
Esteemed Contributor II

The Safari 15.3 release on 2022-02-10 marks what I believe is the 3rd time in a little less than a year that Apple has released an update to Safari with the same version number as the previous release but with a new build number. This means that the CFBundleShortVersionString normally used to identify an app version is useless to determine the actual version of Safari 15.3 installed.

For anyone who wants to create a Smart Group that can differentiate between Safari releases with the same version the EA below will extract the CFBundleVersion value, which is the Build number, from the Safari application bundle so you can use it as a Criteria.

For the new Safari 15.3 release the build number is 16612.4.9.1.8 on macOS Big Sur and 15612.4.9.1.8 on macOS Catalina.

 

 

<?xml version="1.0" encoding="UTF-8"?><extensionAttribute>
<displayName>EA - Get Safari CFBundleVersion</displayName>
<description>Get the full version string for Safari.app since Apple has made the CFBundleShortVersionString useless by repeatedly reusing the same value with different Production builds.</description>
<dataType>string</dataType>
<scriptContentsMac>#!/bin/sh&#13;
&#13;
# EA - Get Safari CFBundleVersion&#13;
&#13;
result="Not Installed"&#13;
PListToCheck="/Applications/Safari.app/Contents/Info.plist"&#13;
&#13;
if [ -f "$PListToCheck" ] ; then&#13;
	result=$( /usr/bin/defaults read "$PListToCheck" CFBundleVersion )&#13;
fi&#13;
&#13;
echo "&lt;result&gt;$result&lt;/result&gt;"</scriptContentsMac>
</extensionAttribute>

 

 

 

7 REPLIES 7

raymondap
Contributor

Literally was on my list to do today. Thanks for this! Why does Apple make management so hard.

sdagley
Esteemed Contributor II

I'd answer that question but I don't think the Jamf Nation moderators would appreciate the profanity it would involve. (Smile emoji omitted intentionally)

Out of curiosity, are you deploying with a policy, or did you make a custom title in Title Editor? We went with a custom title for "Safari (Big Sur)" here...

sdagley
Esteemed Contributor II

Currently it's a Policy installable via Self Service (and there's a Self Service notification that it's a needed update). It'll become a push policy if our Vulnerability Management team makes that call.

Tildo
New Contributor III

@sdagley  I need some help. I have tried to add the script above in an EA in Jamf but I can't seem to get any information back in Jamf. Am I missing some thing?

 

Safari Version.JPG

sdagley
Esteemed Contributor II

@Tildo My post is in the .xml export format for an EA. You need to save the text to a file on your machine (use a .xml extension) then use the Upload button on the Computer Management->Extension Attributes page in your JSS console to import the EA.

Tildo
New Contributor III

Thank you