diff options
author | garykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-09 20:01:16 +0000 |
---|---|---|
committer | garykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-09 20:01:16 +0000 |
commit | 9aa4254430a5d4e713a0a866972a1d71ae088188 (patch) | |
tree | 1ad22e867953bb87888250f639555f19a1ad74c6 /remoting/host/installer/mac/Scripts/remoting_postflight.sh | |
parent | 5276c66be140d1f63f2ca94f72c697aba156a33d (diff) | |
download | chromium_src-9aa4254430a5d4e713a0a866972a1d71ae088188.zip chromium_src-9aa4254430a5d4e713a0a866972a1d71ae088188.tar.gz chromium_src-9aa4254430a5d4e713a0a866972a1d71ae088188.tar.bz2 |
Initial version of the Chromoting installer for Mac.
This must be built manually (run build.sh) and isn't integrated into the gyp
build system yet.
It also requires that you have Iceberg installed on your local machine.
Review URL: https://chromiumcodereview.appspot.com/9958083
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131416 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/installer/mac/Scripts/remoting_postflight.sh')
-rwxr-xr-x | remoting/host/installer/mac/Scripts/remoting_postflight.sh | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/remoting/host/installer/mac/Scripts/remoting_postflight.sh b/remoting/host/installer/mac/Scripts/remoting_postflight.sh new file mode 100755 index 0000000..0b30ed2 --- /dev/null +++ b/remoting/host/installer/mac/Scripts/remoting_postflight.sh @@ -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 |