Install Google Chrome
Summary
This script will install the latest Universal version of Google Chrome.
Script Content
#!/bin/zsh
cd "/Library/Application Support/JAMF/tmp"
# Update variables. These shouldn't need to change for each update
pkgname="googlechrome.pkg"
pkglink="https://dl.google.com/chrome/mac/stable/accept_tos%3Dhttps%253A%252F%252Fwww.google.com%252Fintl%252Fen_ph%252Fchrome%252Fterms%252F%26_and_accept_tos%3Dhttps%253A%252F%252Fpolicies.google.com%252Fterms/googlechrome.pkg"
apptoupdaterunningname="Google Chrome"
# Download PKG
curl -L -o "$pkgname" "$pkglink"
sleep 10
# Kill the app if it is running
killall -Kill "$apptoupdaterunningname"
# Install PKG
sudo installer -pkg $pkgname -target /
# Remove the downloaded PKG
rm $pkgname
# Clear out the used variables
unset pkgname
unset pkglink
unset apptoupdaterunningname
exit 0
Concluding Comments
Google Chrome is pretty much an essential application for any user, this script allows you to know the latest version is always being deployed.
As this script installs the Universal version of Google Chrome, it will natively run on Macs with either Intel (x86_64) or Apple Silicon (arm64) CPUs.