Skip to main content
Question

SPSS Activation Script


Forum|alt.badge.img+2

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

5 replies

Forum|alt.badge.img+8
  • Contributor
  • 56 replies
  • January 31, 2019

Thanks for the script. Is there any reason why you guys are not using a license server? We are upgrading our license server to handle SPSS 25 since SPSS 24 doesn't support checking out licenses on macOS High Sierra according to their support.


Forum|alt.badge.img+10
  • Valued Contributor
  • 108 replies
  • April 15, 2019

What would have to change in the script to convert this to a completely silent reactivation so there are no prompts for the end user (or computer that would be idle)? We have lab computers that we would like to proactively reactivate before a user opens SPSS 25 only to find it is not usable. Ideally we would only see a Jamf log whether or not it was successful or not.


smcmjeff
Forum|alt.badge.img+2
  • New Contributor
  • 13 replies
  • June 26, 2019

I know this is a few months old, but I just wanted to say thanks for the script. We use an internal license server for our desktops and computer labs that have SPSS installed. However, we install the "Authorized user" version on faculty laptops. Like you, we seem to be constantly moving from one version to the next, while still having to support e-license previous versions. Your script provides an elegant solution to this issue.
Thanks again!


Forum|alt.badge.img+2
  • Author
  • New Contributor
  • 1 reply
  • September 30, 2019

@joethedsa Sorry this is 5 months later, but if you just take out the if/then with the dialog boxes "osascript -e ...." it'll run silently.

#!/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
    fi
    if [[ $spssver = *"25"* ]]; then
        cd $spss/contents/bin
        ./licenseactivator $5
    fi
done

mgshepherd
Forum|alt.badge.img+10
  • Contributor
  • 58 replies
  • March 11, 2022

Removed


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings