Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4278)

Unified Diff: chrome/installer/mac/app/copy_to_disk.sh

Issue 2243863003: Added authorized install with a script to do the copy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaned up code and made the script waiting not awkward Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/installer/mac/app/copy_to_disk.sh
diff --git a/chrome/installer/mac/app/copy_to_disk.sh b/chrome/installer/mac/app/copy_to_disk.sh
new file mode 100755
index 0000000000000000000000000000000000000000..8b0c107f7076549af7cb8e122a4e04bb20e2ed20
--- /dev/null
+++ b/chrome/installer/mac/app/copy_to_disk.sh
@@ -0,0 +1,35 @@
+#!/bin/sh -p
+
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This script will be called by the installer application to copy Google
+# Chrome.app into the proper /Applications folder. This script may run as root.
+#
+# When running as root, this script will be invoked with the real user ID set
+# to the user's ID, but the effective user ID set to 0 (root). bash -p is
+# used on the first line to prevent bash from setting the effective user ID to
+# the real user ID (dropping root privileges).
+
+set -euo pipefail
Anna Zeng 2016/08/23 19:36:12 It'd be helpful to include what the flags mean in
ivanhernandez 2016/08/24 18:23:17 nah.
ivanhernandez 2016/08/24 18:28:26 Whoops forgot to change this joke reply to 'Done.'
+
+# Wait's for the main app to pass the path to the app bundle inside the mounted
Elly Fong-Jones 2016/08/24 16:39:22 Wait's -> Waits
ivanhernandez 2016/08/24 18:23:17 Done.
+# disk image.
+read -r SRC
+
+DEST=${1}
Elly Fong-Jones 2016/08/24 16:39:22 quotes here
ivanhernandez 2016/08/24 18:23:17 Done.
+APPBUNDLENAME=$(basename "${SRC}")
+FULL_DEST="${DEST}"/"${APPBUNDLENAME}"
+
+# Starts the copy
+rsync -lrptq "${SRC}" "${DEST}"
Anna Zeng 2016/08/23 19:36:12 Ditto!
ivanhernandez 2016/08/24 18:23:17 Done.
+
+# If this script is run as root, change ownership to root and set elevated
+# permissions.
+if [ "${EUID}" -eq 0 ] ; then
+ chown -Rh root:admin "${FULL_DEST}"
+ chmod -R a+rX,ug+w,o-w "${FULL_DEST}"
+fi
+
+exit 0
« chrome/installer/mac/app/AuthorizedInstall.m ('K') | « chrome/installer/mac/app/OmahaCommunication.m ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698