Hey Jamfers,
My organization has multiple versions of SPSS deployed, so when our yearly license gets renewed it can be a chore to get everyone re-activated as there are different codes for different versions. I put together this script and deployed it through Self-Service, so that people who find themselves unlicensed can quickly re-license their copy. The license codes themselves are stored as parameter input so they can be quickly updated from the policy in the JSS. If anyone else has an environment similar to this, they might find it helpful.
#!/bin/sh
spssdir=$(find /Applications -name SPSSStatistics.app)
for spss in $spssdir; do
spssver=$(plutil -p $spss/Contents/Info.plist | grep CFBundleShortVersionString)
if [[ $spssver = *"24"* ]]; then
cd $spss/contents/bin
./licenseactivator $4
if [ $? -eq 0 ]; then
osascript -e 'tell app "System Events" to display dialog "SPSS 24 Activated!"'
else
osascript -e 'tell app "System Events" to display dialog "There was a problem activating this copy of SPSS. Please contact the Helpdesk." with text buttons {"OK"}'
fi
fi
if [[ $spssver = *"25"* ]]; then
cd $spss/contents/bin
./licenseactivator $5
if [ $? -eq 0 ]; then
osascript -e 'tell app "System Events" to display dialog "SPSS 25 Activated!"'
else
osascript -e 'tell app "System Events" to display dialog "There was a problem activating this copy of SPSS. Please contact the Helpdesk." with text buttons {"OK"}'
fi
fi
if [[ $spssver != *"24"* && $spssver != *"25"* ]];
then
osascript -e 'tell app "System Events" to display dialog "Please contact the Helpdesk for help activating your copy of SPSS" with text buttons {"OK"}'
fi
done