-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGoogle_Chrome_Installation_Script.sh
More file actions
63 lines (52 loc) · 2.07 KB
/
Google_Chrome_Installation_Script.sh
File metadata and controls
63 lines (52 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh
####################################################################################################
#
# Google Chrome Installation Script
#
####################################################################################################
#
# DESCRIPTION
#
# Automatically download and install Google Chrome
#
####################################################################################################
#
# HISTORY
#
#
# 2019/08/17: Forked version, jfilice@csumb.edu
# Added logic to delete existing /Applications/Google\ Chrome.app
# Changed cp to ditto.
# Changed commands to explicite paths.
#
#
# Created by Caine Hörr on 2016-07-25
#
# v1.1 - 2016-10-11 - Caine Hörr
# Added -nobrowse flag to hdiutil attach /tmp/$VendorDMG command line arguments
# Shout out to Chad Brewer (cbrewer) on JAMFNation for this fix/update
# https://jamfnation.jamfsoftware.com/viewProfile.html?userID=1685
#
# v1.0 - 2016-07-25 - Caine Hörr
# Google Chrome Installation script
# Vendor supplied DMG file
VendorDMG="googlechrome.dmg"
# Download vendor supplied DMG file into /tmp/
/usr/bin/curl https://dl.google.com/chrome/mac/stable/GGRO/$VendorDMG -o /tmp/$VendorDMG
# Mount vendor supplied DMG File
/usr/bin/hdiutil attach /tmp/$VendorDMG -nobrowse
# Delete existing target for /Applications/Google\ Chrome.app because it is not a good idea to merge new and old versions.
if [ -e /Applications/Google\ Chrome.app ]; then
/bin/rm -fR /Applications/Google\ Chrome.app
fi
# Copy contents of vendor supplied DMG file to /Applications/
# Preserve all file attributes and ACLs
/usr/bin/ditto /Volumes/Google\ Chrome/Google\ Chrome.app /Applications/Google\ Chrome.app
# Set ownership to root:admin
/usr/sbin/chown -fR 0:80 /Applications/Google\ Chrome.app
# Identify the correct mount point for the vendor supplied DMG file
GoogleChromeDMG="$(hdiutil info | grep "/Volumes/Google Chrome" | awk '{ print $1 }')"
# Unmount the vendor supplied DMG file
/usr/bin/hdiutil detach $GoogleChromeDMG
# Remove the downloaded vendor supplied DMG file
/bin/rm -f /tmp/$VendorDMG