Posted on 06-01-2020 05:51 AM
I need help deploying zoom updates or allowing non-admins to update zoom because zoom is constantly updating. Any suggestions?
Solved! Go to Solution.
Posted on 06-01-2020 06:27 AM
We use the following script. Adapted it a little from original to quit out of zoom if it is open.. We have adapted it from https://www.jamf.com/jamf-nation/discussions/29561/script-to-install-update-zoom
#!/bin/sh
#####################################################################################################
#
# ABOUT THIS PROGRAM
#
# NAME
# ZoomInstall.sh -- Installs or updates Zoom
#
# SYNOPSIS
# sudo ZoomInstall.sh
#
####################################################################################################
#
# HISTORY
#
# Version: 1.1
#
# 1.1 - Shannon Johnson, 27.9.2019
# Updated for new zoom numbering scheme
# Fixed the repeated plist modifications
#
# 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
hdvideo="true"
ssodefault="true"
#ssohost="xxx.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"
processname="zoom.us"
killall "$processname" &> /dev/null
if [ $? -eq 0 ]; then
echo "Killing $processname"
fi
# 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 CFBundleVersion)
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 -sLo /tmp/${pkgfile} ${url}
/bin/echo "`date`: Installing PKG..." >> ${logfile}
/usr/sbin/installer -allowUntrusted -pkg /tmp/${pkgfile} -target /
/bin/sleep 20
/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 CFBundleVersion)
echo "Version on Mac is ${newlyinstalledver}"
if [ "${latestver}" = "${newlyinstalledver}" ]; then
/bin/echo "`date`: SUCCESS: Zoom has been updated to version ${newlyinstalledver}" >> ${logfile}
echo "Zoom updated successfully"
# /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}
echo "Zoom not updated - Installation error"
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
Posted on 06-04-2020 09:55 AM
use patch management- bundle this as a .sh... use composer to run the .sh from /private/tmp:
appname="zoom.us.app"
pkgfile="Zoom.pkg"
file="/Applications/zoom.us.app"
url="https://zoom.us/client/latest/Zoom.pkg"
/bin/echo "--"
/bin/echo "date
: Removing Existing Copy of $appname "
if [ -e "$file" ]
then
echo "$file found; Removing now"
/bin/rm -rf $file
fi
/bin/echo "date
: Downloading latest version."
/usr/bin/curl -Lo /tmp/${pkgfile} ${url}
/bin/echo "date
: Installing..."
/usr/bin/sudo /usr/sbin/installer -pkg /tmp/${pkgfile} -target /
latestver=$(defaults read /Applications/${appname}/Contents/Info.plist CFBundleShortVersionString )
/bin/echo "$(date): Latest Version is: $latestver"
/bin/echo "date
: Deleting PKG file"
/bin/rm /tmp/"${pkgfile}"
exit 0
Posted on 06-01-2020 05:58 AM
The autoupdate flag in their installation customization still requires admin access.
I've since turned off the autoupdate flag so that the client no longer keeps prompting users. Just update the client on Jamf and regularly roll it out instead.
Posted on 06-01-2020 06:27 AM
We use the following script. Adapted it a little from original to quit out of zoom if it is open.. We have adapted it from https://www.jamf.com/jamf-nation/discussions/29561/script-to-install-update-zoom
#!/bin/sh
#####################################################################################################
#
# ABOUT THIS PROGRAM
#
# NAME
# ZoomInstall.sh -- Installs or updates Zoom
#
# SYNOPSIS
# sudo ZoomInstall.sh
#
####################################################################################################
#
# HISTORY
#
# Version: 1.1
#
# 1.1 - Shannon Johnson, 27.9.2019
# Updated for new zoom numbering scheme
# Fixed the repeated plist modifications
#
# 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
hdvideo="true"
ssodefault="true"
#ssohost="xxx.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"
processname="zoom.us"
killall "$processname" &> /dev/null
if [ $? -eq 0 ]; then
echo "Killing $processname"
fi
# 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 CFBundleVersion)
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 -sLo /tmp/${pkgfile} ${url}
/bin/echo "`date`: Installing PKG..." >> ${logfile}
/usr/sbin/installer -allowUntrusted -pkg /tmp/${pkgfile} -target /
/bin/sleep 20
/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 CFBundleVersion)
echo "Version on Mac is ${newlyinstalledver}"
if [ "${latestver}" = "${newlyinstalledver}" ]; then
/bin/echo "`date`: SUCCESS: Zoom has been updated to version ${newlyinstalledver}" >> ${logfile}
echo "Zoom updated successfully"
# /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}
echo "Zoom not updated - Installation error"
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
Posted on 06-01-2020 08:08 AM
Thank you guys for the help!!
Posted on 06-04-2020 09:43 AM
This was working great for us but now just errors out. Is it still working for you all?
Posted on 06-04-2020 09:49 AM
@koestej Yea it's working fine for us.
Posted on 06-04-2020 09:55 AM
use patch management- bundle this as a .sh... use composer to run the .sh from /private/tmp:
appname="zoom.us.app"
pkgfile="Zoom.pkg"
file="/Applications/zoom.us.app"
url="https://zoom.us/client/latest/Zoom.pkg"
/bin/echo "--"
/bin/echo "date
: Removing Existing Copy of $appname "
if [ -e "$file" ]
then
echo "$file found; Removing now"
/bin/rm -rf $file
fi
/bin/echo "date
: Downloading latest version."
/usr/bin/curl -Lo /tmp/${pkgfile} ${url}
/bin/echo "date
: Installing..."
/usr/bin/sudo /usr/sbin/installer -pkg /tmp/${pkgfile} -target /
latestver=$(defaults read /Applications/${appname}/Contents/Info.plist CFBundleShortVersionString )
/bin/echo "$(date): Latest Version is: $latestver"
/bin/echo "date
: Deleting PKG file"
/bin/rm /tmp/"${pkgfile}"
exit 0
Posted on 10-28-2021 07:38 AM
Hello,
Thank you for sharing the script! Is this just for the intel system? I ran the script on my own M1 chip MacBook and It's been installed successfully but it's just asking to update to the compatible version.
Posted on 06-04-2020 10:06 AM
Turns out it was because we put a "/" in the script name and it broke things. We named it Install/Update. Won't make that mistake again and thanks for checking!
Posted on 06-18-2020 06:59 AM
@jwng - can you explain a little further what you mean by "use patch management- bundle this as a .sh... use composer to run the .sh from /private/tmp:"
I packaged the update_zoom.sh script from /var/tmp using composer, set that as the patch management definition, but I'm not understanding how you're actually triggering the script to run.
It's probably something simple that I'm misunderstanding, but I'm having issues packaging the 5.1.0 update and thought this method would be more effective (and easier to manage).
Posted on 06-23-2020 06:40 AM
bundle the shell script as a pkg in composer,
then in composer , create a second post- install script to call the sh. file from /private/tmp/
Posted on 06-23-2020 06:41 AM
Posted on 06-23-2020 06:42 AM
apologies for the delay*
Posted on 06-23-2020 06:43 AM
Posted on 06-24-2020 01:08 PM
Thank you, @jwng !!! That explains it. Thanks again!!
Posted on 06-25-2020 07:39 AM
We built most of our autoupdate-apps in the same manner , (really any installer you can curl). Glad to help
Posted on 06-27-2020 12:31 PM
Really, AutoPKG and JSS Importer can do this much more safely, secure, and with more controls in place
Posted on 06-29-2020 07:18 AM
autopkg and jss importer is great, but you'd have to run autopkg for each version release. At least with an autoupdate script, all you have to do is vet thru the script with a run, and in theory just roll the definitions up in patch management
Posted on 06-29-2020 09:07 AM
Yup and the benefit is that if you ever need to roll back, you have all the versions in your repo, you just need to flip a bit. With a curl script you loose that quality control, and it is much harder to troubleshoot failures. Plus you are now maintaining code that has to run on every endpoint vs code that runs on a single endpoint. AutoPKG also does a lot of health checks that a curl script does not, and can do things like pass a URL to VirusTotal
Posted on 06-29-2020 10:14 AM
Also, unless the CDNs you are hitting use cert pinning, any curl script is also susceptible to a MITM attack
Posted on 10-20-2020 11:58 AM
@jwng So the reason for packaging the script is? Couldn't you just run the script from a policy and achieve the same results? Also I am still trying to figure out, it seems as though you package the script, then add a post-install script to run the same script? Am I missing something about being two scripts, or is there only one? Is the package portion of this process placing the script into /private/tmp and then the post-install script actually running the script?
Posted on 10-20-2020 12:36 PM
So I bundle the zoom script as a pkg so that I can deploy it via patch management policy instead of a standard policy.
Patch policies have very limited payload options versus standard policies.
The pkg payload places the script I want to run in the /var/tmp dir, then the post install script calls the script that was delivered in the payload from /var/tmp. For me it optimizes patch management . I can load the same pkg to the newest version definition in patch management without having to upload a new pkg...
Posted on 01-13-2021 01:33 PM
How did you turn off the auto update in the .pkg. I have been deploying zoom updates however, zoom has been pushing out updates constantly so my users are always getting the promt. I would like to control when we update (Everymoth) by using patch management but don't want my users getting the zoom update prompt every time. Any advice?
Posted on 01-14-2021 02:28 PM
has anyone tested this on the new M1 Chip with Big sur yet? Trying to see if we can get this working on that since there are technically 2 versions of zoom now
Posted on 01-20-2021 10:18 AM
Apparently, the ZoomIT install package will allow for setting a ZAutoUpdate key in a plist file. See https://support.zoom.us/hc/en-us/articles/115001799006-Mass-deployment-with-preconfigured-settings-for-Mac#h_9f50f97d-e769-4a47-a2b3-1f64efc670df
Has anyone tried this or had it work?
I have seen intermittent success with having standard users update. I have a support ticket with Zoom for a working session to look at my config and why it is not working all the time.
Posted on 01-20-2021 12:15 PM
I have that plist sent out and AutoUpdate set to True.
I have 34 users on the last version and another 34 on versions all the way back to 5.1.
Going to forcefully upgrade via policy Friday morning.
Posted on 01-20-2021 12:25 PM
@robertliebsch do you think the AutoUpdate is working on those 34 users with the latest version because they are clicking Update within the app and the reason there are old versions is because users are not clicking the Update?
Posted on 01-20-2021 12:29 PM
They aren't on the latest version. They are on 5.4.7. It is maybe possible they were updated due to the upgrade option in plist. But not 100% sure. I don't know why it isn't working to get to 5.4.9. I don't know what folks are or are not doing, sadly.
Posted on 01-20-2021 05:10 PM
nice code it does work but I would like to ad <Key>PackageRecommend</key> into the mix so the user's can toggle it after the no facebook settings.but i am not quiet sure where to add the line in your code below
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}"
Can you advise?
Edit: I figured it out. Was missing the <dict> (Sorry Very new to scripting)
Posted on 08-24-2022 12:31 PM
It seems like this script no longer works because it can no longer get the current version number, so the URL is incorrect. Does anyone have a fix for this?
Posted on 09-02-2022 06:53 AM
Yes, same issue. The script does not get the latest version hosted by https://zoom.us/download
I can't figure out the problem. Any idea, please ?
Posted on 09-02-2022 07:35 AM
For now, I changed the script to assign the latest version number to the $latestver variable and commented out the commands that get the latest version number. Now I want to learn how to utilize the CURL command.
latestver="5.11.10.10279"
It's quicker than uploading a new package. I just modify the script when a new version comes out. I also put Zoom in Patch Policies so I can check for the latest version.
I don't suppose there's a way to grab that data from the patch policy and apply it to the script?
Posted on 09-02-2022 08:27 AM
IMHO, this is the best option for the moment (even if you need to update the script frequently). Thank you
Hopefully, someone will find out a solution soon
Posted on 09-06-2022 07:33 AM
Same issue here. From terminal:
Latest Version is:
Current installed version is: 5.11.6.9890
/Users/llitz/Desktop/Zoom _Auto_Install_and_Updates.sh: line 65: [: =: unary operator expected
Latest version of the URL is: https://zoom.us/client//ZoomInstallerIT.pkg
installer: Error - the package path specified was invalid: '/tmp/ZoomInstallerIT.pkg'.
09-07-2022 01:44 AM - edited 09-07-2022 02:20 AM
A solution has been found on Slack.
09-07-2022 02:15 AM - edited 09-07-2022 02:19 AM
Credit to Lee R and Matt Conrad on Slack.
#!/bin/sh
#####################################################################################################
#
# ABOUT THIS PROGRAM
#
# NAME
# ZoomInstall.sh -- Installs or updates Zoom
#
# SYNOPSIS
# sudo ZoomInstall.sh
#
####################################################################################################
#
# HISTORY
#
# Version: 1.1
#
# 1.1 - Shannon Johnson, 27.9.2019
# Updated for new zoom numbering scheme
# Fixed the repeated plist modifications
#
# 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
hdvideo="true"
ssodefault="true"
ssohost="lnu-se.zoom.us"
# rm /Library/Preferences/us.zoom.config.plist
# 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' )
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}'`
ulatestver=`/usr/bin/curl -s -A "$userAgent" https://support.zoom.us/hc/en-us/articles/201361963-Release-notes-for-macOS | grep 'version 5.' | head -1 | sed 's/^.*version /version /' | tr -d ' ' | sed -r 's/[(]+/./g' | cut -f1 -d")" | sed 's/version//g'`
echo "$latestver"
echo "$ulatestver"
echo "Installing version ${latestver}";
url="https://zoom.us/client/${ulatestver}/ZoomInstallerIT.pkg"
/usr/bin/curl -L -o /var/tmp/ZoomInstallerIT.pkg ${url};
res=$?
echo "$res"
if test "$res" != "0"; then
echo "the curl command failed with: $res"
exit 1
else
/usr/sbin/installer -pkg /var/tmp/ZoomInstallerIT.pkg -target /;
exit 0
fi
# 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 CFBundleVersion)
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"
#url="https://zoom.us/client/latest/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>enableembedbrowserforsso</key>
<string>false</string>
<key>nogoogle</key>
<string>1</string>
<key>nofacebook</key>
<string>1</string>
<key>DisableLoginWithEmail</key>
<string>1</string>
<key>SetUpdatingChannel</key>
<string>1</string>
<key>ZDisableVideo</key>
<false/>
<key>ZAutoJoinVoip</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>
<false/>
<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 -sLo /tmp/${pkgfile} ${url}
/bin/echo "`date`: Installing PKG..." >> ${logfile}
/usr/sbin/installer -allowUntrusted -pkg /tmp/${pkgfile} -target /
/bin/sleep 20
/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 CFBundleVersion)
echo "Version on Mac is ${newlyinstalledver}"
if [ "${latestver}" = "${newlyinstalledver}" ]; then
/bin/echo "`date`: SUCCESS: Zoom has been updated to version ${newlyinstalledver}" >> ${logfile}
echo "Zoom updated successfully"
# /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}
echo "Zoom not updated - Installation error"
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
Posted on 09-08-2022 11:18 AM
Weird issue.
I get the this error when trying to edit the script in JSS web admin:
403
Access Denied
Contact your IT Administrator for assistance.
I deleted the script and re-added from copy+paste and uploaded from Admin.
When I create a new script and add random text it saves and works, when I go to edit the script and copy+paste the script from this thread, it doesnt save and throws the error.
I guess I can edit offline and use Admin yet I'm concerned there's a larger issue...
Ideas?
Thanks.
Posted on 09-08-2022 12:37 PM
Same thing here. I think it's something Jamf needs to fix. There's a discussion about it here:
Posted on 09-09-2022 06:47 AM
Working for me today.