Skip to main content

Worklet - Chrome Silent Install (Mac OS)

  • February 11, 2021
  • 0 replies
  • 336 views

MatL-Automox
Forum|alt.badge.img

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:

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

Remediation code:

#!/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}

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings