Posted on 11-01-2019 08:09 AM
I'm rolling out OneLogin Desktop in a couple of weeks and to successfully deploy to any pre-10.14.4 machine I need to push out Swift Runtime for CLT. I did this yesterday, but I would love to see if the policy failed on any machines. Not sure how to make a Smart Group for this since Swift for CLT isn't an "app," per se. Any suggestions?
Posted on 11-01-2019 08:19 AM
Something that comes to mind is using pkgutil --pkgs
to see if you can find the Swift Runtime for CLT package receipt. If you can, then add a pipe to the command and grep the receipt name out. An EA would look something like
#!/bin/bash
swiftReceipt=$(pkgutil --pkgs | grep com.apple.pkg.something)
if [ "$swiftReceipt" = "receiptname" ]; then
echo "<result>Swift CLT Installed</result>"
else
echo "<result>Swift CLT Not Installed</result>"
fi
Posted on 11-01-2019 08:38 AM
Interesting. I'll try this later today and post here.
Posted on 11-01-2019 03:00 PM
I got a "Not Installed" response on a machine that I know it was installed on, so I think I might have the receipt name wrong. Will keep digging, but assuming this will work once I get the names right.
Posted on 11-01-2019 03:57 PM
What is the bundle ID of the Swift Runtime?
Posted on 11-04-2019 09:32 AM
Alright, I'm not sure what the Bundle ID is but I did create an Extension Attribute using that same script:
#!/bin/bash
swiftReceipt=$(pkgutil --info com.apple.pkg.SwiftRuntimeForCommandLineTools)
if [ "$swiftReceipt" = "No receipt for 'com.apple.pkg.SwiftRuntimeForCommandLineTools' found at '/'." ]; then
echo "<result>Swift Runtime For CLT Not Installed</result>"
else
echo "<result> Swift Runtime For CLT Installed</result>"
fi
...and scoping it to computers running only older than a 10.14.4 macOS. I'm seeing some results filter into the INSTALLED Smart Group, but not the NOT INSTALLED Smart Group. Will give it some time and update.
Posted on 11-04-2019 10:16 AM
No luck. I checked my work against some of the laptops in the INSTALLED group by running:
pkgutil --info com.apple.pkg.SwiftRuntimeForCommandLineTools
...silently in the background. While I assumed I had a successful install earlier, it clearly did not install. Don't know how I got my Extension Attribute / Smart Group wrong.
Posted on 11-05-2019 01:45 PM
Ok, so my final stab at this is it base a Smart Group of the exit code of an EA script.
#!/bin/bash
exit=?(pkgutil --info com.apple.pkg.SwiftRuntimeForCommandLineTools)
if [ $exit -eq 0 ]
then
echo "Success"
else
echo "Failure" >
fi
I'm not terribly familiar with bash, and this is clearly not working. Any suggestions?
Posted on 11-05-2019 02:03 PM
Can you use the "Packages Installed By Installer.app/SWU" for this?
Posted on 11-05-2019 02:26 PM
Just updated the Smart Group and my one known computer populated. I'll push the install out again and give it some time to run to see if the Smart Groups update. Thanks! I had no idea that was even in option there!
Posted on 11-05-2019 02:49 PM
Got it. You're a genius.