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

Unified Diff: remoting/host/installer/mac/Scripts/remoting_postflight.sh

Issue 9958083: Initial version of the Chromoting installer for Mac. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 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: remoting/host/installer/mac/Scripts/remoting_postflight.sh
===================================================================
--- remoting/host/installer/mac/Scripts/remoting_postflight.sh (revision 0)
+++ remoting/host/installer/mac/Scripts/remoting_postflight.sh (working copy)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# Copyright (c) 2012 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.
+
+HELPERTOOLS=/Library/PrivilegedHelperTools
+NAME=org.chromium.chromoting
+AUTH_FILE="$HELPERTOOLS/$NAME.json"
+PLIST=/Library/LaunchAgents/org.chromium.chromoting.plist
+
+KSADMIN=/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/MacOS/ksadmin
+KSUPDATE=https://tools.google.com/service/update2
+KSPID=com.google.chrome_remote_desktop
+KSPVERSION=0.5
+
+trap onexit ERR
+
+function onexit {
+ # Log an error but don't report an install failure if this script has errors.
+ logger An error occurred while launching the service
+ exit 0
+}
+
+# Update owner and permissions for auth file.
+chown $USER "$AUTH_FILE"
+chmod 600 "$AUTH_FILE"
+
+# Load the service.
+# The launchctl command we'd like to run:
+# launchctl load -w -S Aqua $PLIST
+# However, since we're installing as an admin, the launchctl command is run
+# as if it had a sudo prefix, which means it tries to load the service in
+# system rather than user space.
+# To launch the service in user space, we need to get the current user (using
+# ps and grepping for the loginwindow.app) and run the launchctl cmd as that
+# user (using launchctl bsexec).
+set `ps aux | grep loginwindow.app | grep -v grep`
+# At this point, $1=username and $2=userid
+if [[ -n $1 && -n $2 ]]; then
+ launchctl bsexec "$2" sudo -u "$1" launchctl load -w -S Aqua $PLIST
+fi
+
+# Register a ticket with Keystone so we're updated.
+$KSADMIN --register --productid $KSPID --version $KSPVERSION --xcpath $PLIST --url $KSUPDATE
Property changes on: remoting/host/installer/mac/Scripts/remoting_postflight.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
« no previous file with comments | « remoting/host/installer/mac/Scripts/keystone_install.sh ('k') | remoting/host/installer/mac/Scripts/uninstall.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698