Script to Install & Update Zoom

omatsei
New Contributor III

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
142 REPLIES 142

AdamCraig
Contributor III

@kwoodard They won't need admin credentials to run this. Zoom will still probably ask for admin credentials when it needs to update, but the lazy approach would be to put this into Self Service and say "When it prompts you, install it from Self service again."

The not lazy approach would be to set up patch management for Zoom, and scope a policy that runs this regularly on all computers and exclude those with the latest version of zoom installed.

I've done both for different applications so no judgement here.

kwoodard
Valued Contributor

@strayer You can set patch management to run a script, or are you saying to have the script setup in Self Service to run on demand?

lamador
New Contributor III

I am running your script @strayer and it will grey out these options. Same with the first script posted in this post. I roll out zoom at enrollment and i dont have those keys set so they are not greyed out when first installing. Any ideas?
587a33ac73b74572a8e7980f44233090

AdamCraig
Contributor III

@kwoodard For Zoom I just use patch management to track it and create smart groups for scoping. So I have that policy scoped to all users with Zoom installed, and excluded from users with the latest version.
@lamador I really have no idea, sorry. that script just gets zoom bare bones and installs. It may need additional things enabled in system preferences>Security & Privacy? We don't really use zoom at all, we just want it up to date because everyone installed it anyway due to covid...

Tjernigan
New Contributor III

@GregE
Any idea why when I try and run any of the versions you posted I get this error?

line 61: [: too many arguments

GregE
Contributor

@Tjernigan line 61 for me is # Get the version number of the currently-installed Zoom, if any.

Presuming you've removed a line somewhere and it's the if statement on line 62, check the space around the opening and closing [ ] (I've been caught out by that before).

fsjjeff
Contributor II

Ugh, anyone seeing that Zoom is downgrading clients on certain versions of MacOS? I'm testing Zoom on a 10.15.5 machine right now, running the newest version of Zoom, and it comes up with a note across the top of the app saying you should "upgrade" to a compatible version, but if I try to do so it tries to downgrade Zoom. I'm not finding much in the way of details except for an obscure Reddit conversation from a couple weeks ago which mentions they're seeing this behaviour without knowing why.

msw
Contributor

Thanks to OP for the script — extremely helpful. I've modified a bit for my organization's use and figured I'd post my modified version here in case it's useful for anyone. In the management plist, I have locked the following settings:
- remember the last login type
- display the 'call room' button on app home screen, for use in video conferencing rooms
- allow user to update through app (Zoom menu > Check for update)
- set web domain (set to dummy domain in script below — set your org's custom Zoom domain or remove depending on how you use Zoom)
- pre-configure SSO url (set to dummy SSO URL below)
- default to login with SSO
And set the following are set as package recommends (app defaults that the user can change)
- enable meeting reminders
- disable auto-fullscreen when screensharing is started

Note that all of the settings above, plus all other available settings, are described in this Zoom kbase: https://support.zoom.us/hc/en-us/articles/115001799006-Mass-Deployment-with-Preconfigured-Settings-for-Mac

The only other substantial changes to the script are to make a it a bit more verbose. It now checks if Zoom is running, or if a meeting is running, prints that, and exits successfully if the install was successful, but not applied. Zoom prompts the user with the attached pop-up when an update has been installed but not applied, so I still exit successfully in those cases; only if the update fails do I exit with a failure, and in that case I print the Zoom install log to try to help diagnose the issue.
422797aa48494f10b88be524b95de0cc

Here's the script

#!/bin/sh
#####################################################################################################
#
# ABOUT THIS PROGRAM
#
# NAME
#   ZoomInstall.sh -- Installs or updates Zoom
#
# SYNOPSIS
#   sudo ZoomInstall.sh
#
####################################################################################################
#
# HISTORY
#
#   Version: 1.1sa
#   Updated by mw for use at SA 10/12/20
#   via https://www.jamf.com/jamf-nation/discussions/29561/script-to-install-update-zoom
#
#   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.

# 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

#Variables
pkgfile="ZoomInstallerIT.pkg"
plistfile="us.zoom.config.plist"
ZoomLog="/Library/Logs/zoomusinstall.log"
zoom_test=`ps aux | grep zoom.us | grep -v grep`
#checks if the cpthost process is running; if so, a meeting is active on the device
meeting_test=`ps aux | grep cpthost | grep -v grep`

# 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}'`

    # 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 | sed -e 's/0 //g' -e 's/(//g' -e 's/)//g'`
        if [ ${latestver} = ${currentinstalledver} ]; then
            echo "Zoom is up-to-date. Exiting."
            exit 0
        fi
    else
        currentinstalledver="none"
        echo "Zoom is not installed..."
    fi

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

    # 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>LastLoginType</key>
            <true/>
            <key>appendcallernameforroomsystem</key>
            <true/>
            <key>enablestartmeetingwithroomsystem</key>
            <true/>
            <key>ZAutoUpdate</key>
            <true/>
            <key>setwebdomain</key>
            <string>$CustomZoomDomain</string>
            <key>enableembedbrowserforsso</key>
            <true/>
            <key>ZSSOHost</key>
            <string>$SSODomain</string>
            <key>ZAutoSSOLogin</key>
            <true/>
            <key>PackageRecommend</key>
            <dict>
                <key>EnableRemindMeetingTime</key>
                <true/>
                <key>ZAutoFullScreenWhenViewShare</key>
                <false/>
            </dict>
        </dict>
        </plist>" > /tmp/${plistfile}

        # Download and install new version
        /bin/echo "Installed Zoom version: ${currentinstalledver}"
        /bin/echo "Current Zoom version: ${latestver}"
        /bin/echo "Downloading current version..."
        /usr/bin/curl -sLo /tmp/${pkgfile} ${url}
        /bin/echo "Installing Zoom ${latestver}..."
        /usr/sbin/installer -allowUntrusted -pkg /tmp/${pkgfile} -target /

        /bin/sleep 20
        /bin/echo "Deleting Zoom installer..."
        /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`
    if [ "${latestver}" = "${newlyinstalledver}" ]; then
        /bin/echo "SUCCESS: Zoom has been updated to version ${newlyinstalledver}"
        # /Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType hud -title "Zoom Installed" -description "Zoom has been updated." &
    else
        if [[ "$meeting_test" != "" ]] ; then
            /bin/echo "Zoom update failed to apply because the user is currently in a meeting..."
            /bin/echo "Zoom will prompt user to restart the app to apply update. Exiting..."
            exit 0
        elif [[ "$meeting_test" == "" ]] && [[ "$zoom_test" != "" ]] ; then
            /bin/echo "Zoom update failed to apply because Zoom is currently open..."
            /bin/echo "Zoom will prompt user to restart the app to apply update. Exiting..."
            exit 0
        else
            /bin/echo "ERROR: Zoom update unsuccessful, version remains at ${currentinstalledver}."
            /bin/echo "Printing Zoom install log..."
            /usr/bin/tail -n 30 "$ZoomLog"
            exit 1
        fi
    fi

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

KCouture
New Contributor II

I found the check box for "User dual monitors" is greyed out. I've bene told using ZDualMonitorOn would do the trick. Unless I'm doing it wrong, I've had no luck at making it not greyed out. Any ideas?

Here's part of the code
04e5658313834a1faa550dfdd45fb310

           # 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>ZAutoUpdate</key>
                        <key>PackageRecommend</key>
                        <dict>
                            <key>ZDualMonitorOn</key>
                            <true/>
                          </dict>
                        </plist>" > /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>
                        <false/>       

                </dict>
                </plist>" >> /tmp/${plistfile}

erichughes
Contributor II

Get rid of the <dict> above and indents for that key.

KCouture
New Contributor II

@erichughes so like this, correct?

  # 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>ZAutoUpdate</key>
                        <key>PackageRecommend</key>
                        <key>ZDualMonitorOn</key>
                        <true/>
                        </dict>
                        </plist>" > /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>
                        <false/>       

                </dict>
                </plist>" >> /tmp/${plistfile}

KCouture
New Contributor II

Answered my own question, maybe. Ran it that way and it did not un-grey itself

erichughes
Contributor II

That looks more correct. But I don't know anything about that specific key. We don't manage Zoom, just make it available if needed. That item is not grayed out for me, but I'm not deploying a plist for Zoom. Do the other keys work as expected with your deployed plist?

KCouture
New Contributor II

@erichughes I believe so, I'll need to double check. I did see this post which I might try out. The thing I love about this script is it downloads the latest package for us. Which I guess we can still do, just take the the plist stuff?

erichughes
Contributor II

We use the basics of this script to instal for users who request Zoom and the also to keep them up to date. Static group scoped to a policy for install and a smart group that compares versions via EA, scoped to policy to keep them updated. When / If they ever execute it in Self Service.

kwoodard
Valued Contributor

We don't manage Zoom at all, people can use it if they wish. I suck at scripting and have been trying to get a script that will merely run in the background (preferably at startup when nothing is launched), check the version to see if it needs to be updated, and updates it without the user needing to know or add in admin credentials (which they don't have) to get things to install.

Messing with patch management, AutoPKG, auto uploading to the JSS... All this is a foreign language. It also seems that AutoPKG is no longer being updated? Am I missing something there? Working from home, I have to remote into my on-site computer to get apps uploaded and do a lot of the Jamf management. I can do some things via the web interface, but being that we only have on-prem, its hard to get some stuff done. I'm trying to script as much as I can to do things.

atomczynski
Valued Contributor

Hi @kwoodard

I moved to JamfCloud today so feeling happy and thought I'd contribute to Jamfnation.

I can read some scripts and modify some and understand there is always more to learn.

I use the install script from this thread to deploy Zoom
The script is very slightly modified, and in the script I

#!/bin/sh
# out few lines
# and put some notes into the script
# and reference this thread
# and change the script very so slightly

I have few policies for Zoom.
Zoom: Main Install Policy Frequency: ongoing, Trigger: superdupernametriggerhere Scope: All computers
(this is the policy that does the legwork)

Zoom: Install (Auto Install) Frequency: ongoing, Trigger: login Scope: (computers that are supposed to have Zoom installed)

Zoom: Install (Force Update) Frequency: ongoing, Trigger, login, startup Scope: (smartgroup that has app install zoom but is not at version X)
I know this is not the best way to go about it but I understand I need to learn and there is a better way, the better way is to have application install but at version less than xyz as an example but I need to learn regex

Zoom: Install (UPdate) via Self Service) Frequency: Ongoing Trigger: Self Service Scope: (smart group of application installed zoom)
^^ This is a policy users may choose to run if they want to update to latest version on their own ^^

As a side note, another app I download from the internet is Google Chrome while the majority is packaged with a few sprinkled from the Mac App Store.

GregE
Contributor
zoom_test=`ps aux | grep zoom.us | grep -v grep`
#checks if the cpthost process is running; if so, a meeting is active on the device
meeting_test=`ps aux | grep cpthost | grep -v grep`

@msw-sa That is a little beauty, have updated my Google Chrome script for updating the .plist to whitelist our domain using the above - cheers!

msw
Contributor

@KCouture not sure constructing your plist like that will work. The first section prints creates plist file, and closes the </dict> and </plist> tags. All the subsequent echo commands will add keys outside the dict and plist, which I expect would fail. You can check console in /Library/Logs/zoominstall.log to confirm. If you don't see "plutil result: /tmp/us.zoom.config.plist: OK" in the log, or see anything about there being a problem with the plist, it's not properly formatted and won't apply those settings. I'm not really sure the purpose of making conditionals for adding plist keys — I would recommend putting your whole plist in the first echo. If for some reason you need to do it with the conditionals, you could possibly do it with a defaults write command, but again not sure why you'd bother.

You've almost got the package recommends, just add 1 tab before the key, and the true, like so

                        <key>PackageRecommend</key>
                            <key>ZDualMonitorOn</key>
                            <true/>
                 </dict>
                 </plist>

@atomczynski Just a general recommendation, wouldn't lean so heavily on startup and login triggers, particularly startup, for installing software. There won't be an internet connection right away, if anything running requires a user there won't be one logged in, etc. As for using a login a trigger, that policy will run each new login, but also each screen unlock if you manage screensavers/require screens to lock after X amount of time, or if users enable those settings themselves; recurring check-in with an execution frequency of weekly might be cleaner.

@kwoodard I would read this post earlier in the thread, https://www.jamf.com/jamf-nation/discussions/29561/script-to-install-update-zoom#responseChild200720, and review the Zoom article I linked that explains the plist options, to achieve that functionality. Anything installed by jamf runs as root so the user won't need admin credentials. See my note above about using the startup trigger — again would recommend a recurring check-in with a weekly frequency for something more lightweight and reliable.

atomczynski
Valued Contributor

@msw-sa Good catch!

Thanks.

I looked at the policy some more and I actually have an exclusion built into the policy so the Auto Installer does not run on computers with the app installed.

kwoodard
Valued Contributor

Here is what I came up with. Can you all look it over to see if I missed anything? All I am needing to do is install Zoom, update Zoom, and not need admin credentials to do it.

#!/bin/bash

#https://www.jamf.com/jamf-nation/third-party-products/files/1051/install-latest-zoom-client

# this is the full URL
url="https://zoom.us/client/latest/ZoomInstallerIT.pkg"

# change directory to /private/tmp to make this the working directory
cd /private/tmp/

# download the installer package and name it for the linkID
/usr/bin/curl -JL "$url" -o "ZoomInstallerIT.pkg"

# install the package
/usr/sbin/installer -pkg "ZoomInstallerIT.pkg" -target /

# remove the installer package when done
/bin/rm -f "ZoomInstallerIT.pkg"

exit 0

KCouture
New Contributor II

@msw-sa, thanks for the heads up. Something I noticed is on my test box(new build in this case), the box isn't greyed out with the same deployment package(the one I've been messing with), but with my daily driver, it is staying greyed out. Even some users that are nice enough to help me test are finding the same thing.

Is there cached files sticking around somewhere that need to be cleared out to act like a new deployment for this change?

msw
Contributor

@kwoodard looks fine to me. If a policy with this script is scoped to run on machines where Zoom is out-of-date, I think you're good to go.

@KCouture It turns out there are other files that cache some settings. This Zoom kbase suggests that you should go to the Zoom menu and select Uninstall to cleanly remove all files; to do so manually, I believe you will need to remove the following:
- ~/Library/Application Support/zoom.us
- /Library/Preferences/us.zoom.config.plist
- any temporary locations you have have created us.zoom.config.plist during installation, if you aren't removing that copy as part of the script
- Zoom app itself

The one I was missing was the Application Support folder, which appears to cache some of the settings. I didn't test this myself bc I was done testing by the time I got a response, but Zoom support advised me the Uninstall menu item removes everything.

nateee
New Contributor II

Is anyone experiencing issues with this script on Big Sur, Apple M1 and using it during the DEPNotify provisioning process? It seems very random but sometimes during the DEPNotify provision process for some reason the laptop restarts out of nowhere typically during or right after this script finishes, other times it installs without an issue.

cbrewer
Valued Contributor II

@nateee The script at the top of this post looks for Intel architecture. Start with something like what @kwoodard posted and add to it as you need. My only recommendation there would be to use a temp dir created by mktemp and not just use /tmp. You could also add some logic to check if Zoom is already running (pgrep) before blindly triggering an install.

Edit: Feel free to use or take ideas from my Zoom install script.

https://github.com/cwmcbrewster/Jamf_Scripts/blob/master/Install_Zoom.sh

walt
Contributor III

a couple of questions regarding this script:

• Does anyone know if this script or the latest update 5.4.59780.1220 is M1 / Apple Silicon compatible? or do you need separate installers for both? I see zoom has a separate M1 pkg on their site..

• and to keep it updated in a Jamf smart group scope, what variables would I need to keep updated? so far it seems to be finding the latest version but I am still trying to better understand the regex logic:

- Application title - is - Zoom.app
and - Application version - matches regex - ^0-4].
or - Application Version - matches regex - ^5.[0-3].
or - Application Version - matches regex - ^5.3.0.

no paratheses are used in the criteria

cbrewer
Valued Contributor II

@walt

I think there are 2 5.4.7 installers right now. Hopefully they make a single universal in the future.

@talkingmoose has a script that makes it really easy to generate the regex needed.

https://gist.github.com/talkingmoose/2cf20236e665fcd7ec41311d50c89c0e

walt
Contributor III

@cbrewer sorry for the edits, trying again with both 5.4.59780.1220 and 5.4.7 (59780.1220), since zoom seems to have various identifieres. the first one I found in the "install and update latest zoom" script policy log and the other referenced from the regex script.

the regex script it outputs:

Version string is 
Adjusted version string for parsing is ""
Number of sequences is 0
Replacing digits in sequences to get the sequence dividers ""

Adding original version string to end of regex as a potential match.


Regex for "" or higher (8 characters):

^(|.*)$

walt
Contributor III

any recommendations on updating these regex settings to ensure it downloads the latest zoom? I am still trying to better understand regex configurations and settings;

  • Application title - is - Zoom.app and - Application version - matches regex - ^0-4]. or - Application Version - matches regex - ^5.[0-3]. or - Application Version - matches regex - ^5.3.0.

no paratheses are used in the criteria

thanks

atomczynski
Valued Contributor

In version 1.1 of the script in this thread I have noticed that the log shows the following:

Script result: Latest Version is: 5.4.59780.1220
Current installed version is: 5.4.59780.1220
Zoom is current. Exiting

However the up to date version is installed.

lukasindre
New Contributor III

@omatsei Does this script live in github anywhere? I'm working on compatibility with a mixed environment of intel/M1s and would like the latest version (if its not the one posted above in this thread)

lukasindre
New Contributor III

it does now. I'll update this thread when i test on an M1, but this installs the universal pkg, no matter the architecture, on an intel machine. I'll merge to main when i test to make sure this works on an M1, should be tomorrow

lukasindre
New Contributor III

tested on a few m1s and t2s, and this script installs universal binary on both https://github.com/lukasindre/jamf_stuff/blob/master/zoominstall.sh, thanks @omatsei for the huge foundation!

msw
Contributor

A quick note about my script, which was based on the OP. I didn't check this, but it turns out the first test, which is supposed to check the processor and evaluate as false if not i386 or x86_64, always evaluates as true, even on M1 hardware. I just tested the script on an M1 MBA, and it installed Zoom even though /usr/bin/uname -p returns arm, so should cause it to echo "ERROR: This script is for Intel Macs only." and do nothing else.

This is the line I'm talking about:

if [ '`/usr/bin/uname -p`'="i386" -o '`/usr/bin/uname -p`'="x86_64" ]; then

Since Zoom is distributing a universal version of the app now anyway, I didn't bother spending time to figure out why this test isn't working and just removed it. The script works on both Intel and M1 hardware either way (since the first test, incorrectly, always evaluates as true), but I removed it since there's no reason to have a bad test condition in the script.

kwoodard
Valued Contributor

@msw-sa I was just about to come and ask about needing that line of code now that they are using a universal binary. Nice thing that I don't have to alter my basic script to accomodate the new M1's...

mschroder
Valued Contributor

@msw-sa You could have used

if [ `/usr/bin/uname -p` = "i386" -o `/usr/bin/uname -p` = "x86_64" ]; then

or test for 'arm' and simply turn around the if and else part.

msw
Contributor

Agreed, but since knowing the processor architecture is no longer relevant for a Zoom install, I just removed that part of the script completely. Thanks

Colezy
New Contributor

Hello All, hope you are well.
I am trying to update Zoom on all MacBook's with no user interaction.
When I use this script

#!/bin/bash

# this is the full URL
url="https://zoom.us/client/latest/ZoomInstallerIT.pkg"

# change directory to /private/tmp to make this the working directory
cd /private/tmp/

# download the installer package and name it for the linkID
/usr/bin/curl -JL "$url" -o "ZoomInstallerIT.pkg"

# install the package
/usr/sbin/installer -pkg "ZoomInstallerIT.pkg" -target /

# remove the installer package when done
/bin/rm -f "ZoomInstallerIT.pkg"

exit 0

I get this error.
ec6f132214da48ba9249ad0c520adcfa

Or when I use Jamf patch management I get this pop after the install.
f21c069bb18a4355a5e2bd1d0a0444fb

Have I missed something?
Ideally I would like to use the script as it would keep Zoom up to date.

Any help would be great.
Thank you
Harry

Edited.......
Solved issue. Found that someone else created an patch update so both was running at the same time.
Thanks.

jpuebs
New Contributor III

Hi @Colezy , I might be oversimplifying it but could you set the policy/script to run once per month per computer? That's how we have it set up anyway.

kwoodard
Valued Contributor

Hey @Colezy like @jpuebs said, I have the script/policy run once per month, per computer. I never see those errors you are seeing.