Skip to main content

Parallels Desktop 26 was recently released, but whilst attempting to deploy it to users using Jamf Pro I quickly identified that the traditional deployment method which Parallels are providing using their deployment package does not work beyond Parallels Desktop 20. And as Jamf also don’t provide an App Installer for Parallels Desktop 26, this lead me to look at alternative deployment methods.

 

The result is that I have created a scripted process whilst will download & install the latest version of Parallels Desktop 26, then a license key is also fed into the script, the activation of Parallels Desktop 26 will also be performed. Below is the script that I want to share incase any other Jamf Pro admins are stuck with trying to deploy Parallels Desktop 26.

 

#!/bin/bash

cd "/Library/Application Support/JAMF/tmp"

# Update variables. These shouldn't need to change for each update
dmgName="ParallelsDesktop.dmg"
dmgLink="https://link.parallels.com/pdfm/v26/dmg-download/?experience=enter_key"
appRunningName="Parallels Desktop"
appServiceRunningName1="prlctl"
appServiceRunningName2="prl_client_app"
appName="Parallels Desktop.app"


# Parallels Desktop license key
# Uncomment 'licenseKey' variable below and add license key to enable activation
#licenseKey="XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX"


# Download latest Parallels Desktop DMG
echo "Downloading latest Parallels Desktop DMG..."
curl -L -o $dmgName "$dmgLink"


# Mount the Parallels Desktop .DMG
echo "Mounting $dmgName..."
hdiutil mount -nobrowse $dmgName

# Grab the name of the mounted .dmg as it changes with each version
dmgMountedName=`ls /Volumes | grep "Parallels"`
echo "The DMG mounted is: $dmgMountedName"


# Check to see if Parallels Desktop is install, then if it is ensure it is not running
echo "Checking for any existing installation of Parallels Desktop..."

if > -d "/Applications/$appName" ]; then
ParallelsVersion=`defaults read "/Applications/$appName/Contents/version.plist" CFBundleShortVersionString`
echo "The currently installed version of Parallels Desktop is v$ParallelsVersion"

# Kill the app if it is running
echo "Killing the app if it is running..."
killall -Kill "$appRunningName"
killall -Kill "$appServiceRunningName1"
killall -Kill "$appServiceRunningName2"
rm -rf "/Applications/$appName"
else
echo "No existing versions of Parallels Desktop detected."
fi


# Install Parallels Desktop from DMG
echo "Starting Parallels Desktop installation..."

"/Volumes/$dmgMountedName/$appName/Contents/MacOS/inittool" install -t "/Applications/$appName" -s

if > -d "/Applications/$appName" ]; then
ParallelsVersion=`defaults read "/Applications/$appName/Contents/version.plist" CFBundleShortVersionString`
echo "Parallels Desktop version $ParallelsVersion is now installed."
else
echo "Parallels Desktop has failed to install correctly."
exit 1
fi


# Activate Parallels Desktop license
echo "Determining license activation method..."

if > "$licenseKey" != "" ]; then
sudo prlsrvctl install-license -k $licenseKey
echo "Parallels Desktop has been activated using license key."
else
echo "No license provided. Parallels Desktop will require activating manually upon use."
fi


# Unmount the DMG
hdiutil unmount "/Volumes/$dmgMountedName"


# Remove the downloaded DMG
rm "/Library/Application Support/JAMF/tmp/$dmgName"


# Clear out the used variables
unset dmgName
unset dmgLink
unset appRunningName
unset appServiceRunningName1
unset appServiceRunningName2
unset appName
unset licenseKey
unset dmgMountedName
unset ParallelsVersion

exit 0

 

One of the key benefits too of using this script is that as further versions of Parallels Desktop 26 are released, it will automatically be deploying the latest version. Whereas the tradition deployment bundle option Parallels have documented for enterprise deployment requires a new package creating for every release. My hopes are that this will save time for those in the community which need to deploy Parallels Desktop.

 

This script when packaged also works great with Patch Management should you wish to leverage that as the triggering mechanism for updating existing installations of Parallels Desktop across a fleet of Macs.

Be the first to reply!

Reply