AutomoxAutomox

Worklet - Chrome Silent Install (Mac OS)

MatL-Automox
February 11, 2021 at 5:15 pm UTC

This Worklet will install Chrome silently on end-user devices. This is helpful if you push extensions and bookmarks via Google Workspace (this requires user signs into Chrome with their work email). Helpful for onboarding if your company prefers Chrome over other browsers.

Evaluation code:

5 lines
if [[ -d "/Applications/Google\ Chrome.app" ]]; then
  exit 1
else
  exit 0
fi

Remediation code:

bash22 lines
#!/bin/bash

temp=$TMPDIR$(uuidgen)

mkdir -p ${temp}/mount

echo "Downloading Chrome..."
if curl https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg > ${temp}/1.dmg; then
    echo "Downloaded Chrome"
else 
    echo "Something went wrong downloading" && exit 1
fi

echo "Mounting and installing..."
yes | hdiutil attach -noverify -nobrowse -mountpoint ${temp}/mount ${temp}/1.dmg
cp -r ${temp}/mount/*.app /Applications

echo "Detaching..."
hdiutil detach ${temp}/mount

echo "Cleaning up..."
rm -r ${temp}

This discussion is archived and closed to replies. Continue it in the Automox Community Slack.

Discuss on Slack