Skip to main content

We use Zoom a lot, so I modified a script that we were using for Firefox (Thanks Joe Farage!) to install or update to the newest version of Zoom. This one enables HD video, sets SSO logins to be default, and configures the URL for SSO. Below is the script:



#!/bin/sh
#####################################################################################################
#
# ABOUT THIS PROGRAM
#
# NAME
# ZoomInstall.sh -- Installs or updates Zoom
#
# SYNOPSIS
# sudo ZoomInstall.sh
#
####################################################################################################
#
# HISTORY
#
# Version: 1.0
#
# - Shannon Johnson, 28.9.2018
# (Adapted from the FirefoxInstall.sh script by Joe Farage, 18.03.2015)
#
####################################################################################################
# Script to download and install Zoom.
# Only works on Intel systems.
#

# Set preferences - set to anything besides "true" to disable
hdvideo="true"
ssodefault="true"
ssohost="psu.zoom.us"


# choose language (en-US, fr, de)
lang=""
# CHECK TO SEE IF A VALUE WAS PASSED IN PARAMETER 1 AND, IF SO, ASSIGN TO "lang"
if [ "$4" != "" ] && [ "$lang" == "" ]; then
lang=$4
else
lang="en-US"
fi

pkgfile="ZoomInstallerIT.pkg"
plistfile="us.zoom.config.plist"
logfile="/Library/Logs/ZoomInstallScript.log"

# Are we running on Intel?
if [ '`/usr/bin/uname -p`'="i386" -o '`/usr/bin/uname -p`'="x86_64" ]; then
## Get OS version and adjust for use with the URL string
OSvers_URL=$( sw_vers -productVersion | sed 's/[.]/_/g' )

## Set the User Agent string for use with curl
userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X ${OSvers_URL}) AppleWebKit/535.6.2 (KHTML, like Gecko) Version/5.2 Safari/535.6.2"

# Get the latest version of Reader available from Zoom page.
latestver=`/usr/bin/curl -s -A "$userAgent" https://zoom.us/download | grep 'ZoomInstallerIT.pkg' | awk -F'/' '{print $3}'`
echo "Latest Version is: $latestver"

# Get the version number of the currently-installed Zoom, if any.
if [ -e "/Applications/zoom.us.app" ]; then
currentinstalledver=`/usr/bin/defaults read /Applications/zoom.us.app/Contents/Info CFBundleShortVersionString`
echo "Current installed version is: $currentinstalledver"
if [ ${latestver} = ${currentinstalledver} ]; then
echo "Zoom is current. Exiting"
exit 0
fi
else
currentinstalledver="none"
echo "Zoom is not installed"
fi

url="https://zoom.us/client/${latestver}/ZoomInstallerIT.pkg"

echo "Latest version of the URL is: $url"
echo "`date`: Download URL: $url" >> ${logfile}

# Compare the two versions, if they are different or Zoom is not present then download and install the new version.
if [ "${currentinstalledver}" != "${latestver}" ]; then

# Construct the plist file for preferences
echo "<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>nogoogle</key>
<string>1</string>
<key>nofacebook</key>
<string>1</string>
<key>ZDisableVideo</key>
<true/>
<key>ZAutoJoinVoip</key>
<true/>
<key>ZDualMonitorOn</key>
<true/>" >> /tmp/${plistfile}

if [ "${ssohost}" != "" ]; then
echo "
<key>ZAutoSSOLogin</key>
<true/>
<key>ZSSOHost</key>
<string>$ssohost</string>" >> /tmp/${plistfile}
fi

echo "<key>ZAutoFullScreenWhenViewShare</key>
<true/>
<key>ZAutoFitWhenViewShare</key>
<true/>" >> /tmp/${plistfile}

if [ "${hdvideo}" == "true" ]; then
echo "<key>ZUse720PByDefault</key>
<true/>" >> /tmp/${plistfile}
else
echo "<key>ZUse720PByDefault</key>
<false/>" >> /tmp/${plistfile}
fi

echo "<key>ZRemoteControlAllApp</key>
<true/>
</dict>
</plist>" >> /tmp/${plistfile}

# Download and install new version
/bin/echo "`date`: Current Zoom version: ${currentinstalledver}" >> ${logfile}
/bin/echo "`date`: Available Zoom version: ${latestver}" >> ${logfile}
/bin/echo "`date`: Downloading newer version." >> ${logfile}
/usr/bin/curl -L -o /tmp/${pkgfile} ${url}
/bin/echo "`date`: Installing PKG..." >> ${logfile}
/usr/sbin/installer -allowUntrusted -pkg /tmp/${pkgfile} -target /

/bin/sleep 10
/bin/echo "`date`: Deleting downloaded PKG." >> ${logfile}
/bin/rm /tmp/${pkgfile}

#double check to see if the new version got updated
newlyinstalledver=`/usr/bin/defaults read /Applications/zoom.us.app/Contents/Info CFBundleShortVersionString`
if [ "${latestver}" = "${newlyinstalledver}" ]; then
/bin/echo "`date`: SUCCESS: Zoom has been updated to version ${newlyinstalledver}" >> ${logfile}
# /Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType hud -title "Zoom Installed" -description "Zoom has been updated." &
else
/bin/echo "`date`: ERROR: Zoom update unsuccessful, version remains at ${currentinstalledver}." >> ${logfile}
/bin/echo "--" >> ${logfile}
exit 1
fi

# If Zoom is up to date already, just log it and exit.
else
/bin/echo "`date`: Zoom is already up to date, running ${currentinstalledver}." >> ${logfile}
/bin/echo "--" >> ${logfile}
fi
else
/bin/echo "`date`: ERROR: This script is for Intel Macs only." >> ${logfile}
fi

exit 0

I have copied the latest script (above) but I still get Policy Error Code 2100 when running "jamf policy -event zoom -verbose"



ok, script now running fine. I found this support thread regarding a '/' in the policy title.
https://www.jamf.com/jamf-nation/discussions/20342/script-runs-fine-on-machine-fails-as-a-policy



Thank again for your help :)


What can I do if we do not use a domain and are using the free upgrade due to COVID-19? This script forces a domain?


you can remove the line item for domain



<key>ZAutoSSOLogin</key>
<true/>
<key>ZSSOHost</key>
<string>$ssohost</string>"



can be removed to be suited to your needs


The script from 4-5-2020 runs and completes for me.



I do have one problem. the .plist file is not being updated and I'm unable to locate it.
Ideas?


@atomczynski its located at /Library/Preferences/us.zoom.config.plist.


Here's what we do for ours. It's a multi pronged approach that several pieces need to be in place before updated.




  1. We have an extension attribute that runs on the endpoint and compares what the current shipping version of Zoom vs what the user has installed. If it's out of date it gets the attribute 'Old'. If it's the current version, it is 'Latest'.


  2. We have a smart group that is scoped to that extension attribute and only add 'Old' devices.


  3. Once a day a policy runs against machines that are in the 'Old' smart group. The script within the policy pulls the latest IT installer version from Zoom and installs it to their computer.




This is the installer script for the policy.



#!/bin/bash
# This script runs within a policy is scoped to devices listed as 'Old' in the Extension Attribute.
OSvers_URL=$( sw_vers -productVersion | sed 's/[.]/_/g' )

userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X ${OSvers_URL}) AppleWebKit/535.6.2 (KHTML, like Gecko) Version/5.2 Safari/535.6.2"

# Get the latest version of Reader available from Zoom page.
latestver=`/usr/bin/curl -s -A "$userAgent" https://zoom.us/download | grep 'ZoomInstallerIT.pkg' | awk -F'/' '{print $3}'`

echo "Installing version ${latestver}";

url="https://zoom.us/client/${latestver}/ZoomInstallerIT.pkg"

# Construct the plist file for preferences
echo "<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>nogoogle</key>
<true/>
<key>nofacebook</key>
<true/>
<key>disableloginwithemail</key>
<true/>
<key>LastLoginType</key>
<true/>
<key>ZAutoUpdate</key>
<true/>
<key>ZAutoJoinVoip</key>
<true/>
<key>ZAutoSSOLogin</key>
<true/>
<key>ZSSOHost</key>
<string>pretendco.zoom.us</string>
<key>ZRemoteControlAllApp</key>
<true/>
</dict>
</plist>" >> /var/tmp/us.zoom.config.plist;

/usr/bin/curl -L -o /var/tmp/ZoomInstallerIT.pkg ${url};

/usr/sbin/installer -pkg /var/tmp/ZoomInstallerIT.pkg -target /;


This is the extension attribute to label the device as 'Old' or 'Latest'



#!/bin/bash
# This script is used as an extension attribute and compares
# the IT installer version on the Zoom site vs what the user is running
if [ ! -d "/Applications/zoom.us.app" ]; then
echo "<result>Not Installed</result>"
exit 0

else

# Determine current OS version to pass to user string
OSvers_URL=$( sw_vers -productVersion | sed 's/[.]/_/g' )
# Create useragent to pass into curl command
userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X ${OSvers_URL}) AppleWebKit/535.6.2 (KHTML, like Gecko) Version/5.2 Safari/535.6.2"
# Pull current available version of Zoom from their site
latestver=`/usr/bin/curl -s -A "$userAgent" https://zoom.us/download | grep 'ZoomInstallerIT.pkg' | awk -F'/' '{print $3}'`
# Get current version installed on computer
installedVersion=$( defaults read /Applications/zoom.us.app/Contents/Info.plist CFBundleVersion )
# Compare zoom version vs installed version, print result

if [ "$latestver" == "$installedVersion" ]; then
echo "<result>Latest</result>"
exit 0
else
echo "<result>Old</result>"
exit 0
fi
fi

This is great, thanks for sharing, @dmarcnw ! Has anyone created something similar or recommend a way to modify this EA to show the current installed version? This would be more for reporting than scoping.


Hey @JMenacker



I modified the EA by @dmarcnw so it will display the version of Zoom installed for you:



#!/bin/bash
# This script is used as an extension attribute and displays
# the current version of Zoom installed on a Mac
if [ ! -d "/Applications/zoom.us.app" ]; then
echo "<result>Not Installed</result>"
exit 0

else

# Get current version installed on Mac
installedVersion=$( defaults read /Applications/zoom.us.app/Contents/Info.plist CFBundleVersion )

# Display current version installed on Mac
echo "Current Zoom version is: $installedVersion"
exit 0
fi

Hi, thank you and this is brilliant...



However, i wish to simply push the us.zoom.config.plist to the /Library/Preferences/ directory, for existing Zoom installations. Doing this does NOT change the Zoom client config. Should this be possible, or does it REQUIRE a full reinstall with the plist file alongside with the pkg?


@ajhstn, you may find this useful. It’s a manifest to help you set Zoom settings using a configuration profile.



https://www.jamf.com/jamf-nation/discussions/35399/zoom-update-is-requiring-admin-credentials-in-self-service#responseChild200596


I want to answer my own question i posted here, it might be useful to someone.



However, i wish to simply push the us.zoom.config.plist to the /Library/Preferences/ directory, for existing Zoom installations. Doing this does NOT change the Zoom client config. Should this be possible, or does it REQUIRE a full reinstall with the plist file alongside with the pkg?


The answer is;
-- https://zoom.us/client/latest/Zoom.pkg does not recognise /Library/Managed Preferences/ or /Library/Preferences
-- https://zoom.us/client/latest/ZoomInstallerIT.pkg does recognise both paths above.



So if you want to just push a config to an existing Zoom client, you must make sure that Zoom was installed using the ZoomInstallerIT.pkg package, not Zoom.pkg.


@ajhstn,
a zillion thanks for this tip. I literally spent most than half the day trying to figure out why my plists would not stick. The funny thing was that some things like auto sso login were loading and some were not and so I was convinced that I entering the plist wrong. I also found out the Zoom client was also storing some settings in ~/Library/Application Support/zoom.us/data/zoomus.db -- really fustrating!


@talkingmoose that manifest worked really well for me. thank you!


[~mmark - childrensnational], thanks for feedback! Glad to hear it's working.


Today I see some failures of install.



Script result: Latest Version is: 5.0.23508.0430
Current installed version is: 4.6.20561.0413
Latest version of the URL is: https://zoom.us/client/5.0.23508.0430/ZoomInstallerIT.pkg
installer: Package name is Zoom
installer: Upgrading at base path /
installer: The upgrade was successful.
Version on Mac is 4.6.20561.0413
Zoom not updated - Installation error

I am also getting that but suspect it may be due to Zoom running at the time it's trying to upgrade? I have mine set to run at login so it shouldn't be that reason, but there's no consistency to the Macs that fail (OS versions).


I see that error too and you are correct that this is because Zoom is running. I will try some more logic with buttons but for now I added to the jamf helper notification in the Script to notify that the end user will need to quit zoom and reopen for the update to take effect.


Out of curiosity, is including the .plist with the .pkg better practice compared to utilizing a configuration profile and the Custom Settings payload?


Is anyone having problems with this line? I am not returning any result for this...



EDIT: Nvm, I forgot to include the variables inside the command. Disregard.



#!/bin/sh
latestver=`/usr/bin/curl -s -A "$userAgent" https://zoom.us/download | grep 'ZoomInstallerIT.pkg' | awk -F'/' '{print $3}'`
echo "Latest Version is: $latestver"

@ajhstn What method did you use or how did you push the us.zoom.config.plist to the /Library/Preferences/ directory? I'm not having any luck with Composer?


@stmpl10



https://www.jamf.com/jamf-nation/discussions/35399/zoom-update-is-requiring-admin-credentials-in-self-service#responseChild202203



answered you other thread, but you can just make the plist as you want then drop it into composer.


Do I actually have to have the *.pkg file in the local disk of the Computers in the Scope?


I would like to use the above script without the plist options. We don't use Zoom SSO or control how users connect. Can I just edit the plist section out of the script?


@erichughes yes ofc, just deploy the zoomIT pkg if thats all you desire.


How do I modify the script to allow Google instead of an SSO?


Reply