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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
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
OLDNEW
(Empty)
1 #!/bin/sh
2
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 HELPERTOOLS=/Library/PrivilegedHelperTools
8 NAME=org.chromium.chromoting
9 AUTH_FILE="$HELPERTOOLS/$NAME.json"
10 PLIST=/Library/LaunchAgents/org.chromium.chromoting.plist
11
12 KSADMIN=/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Content s/MacOS/ksadmin
13 KSUPDATE=https://tools.google.com/service/update2
14 KSPID=com.google.chrome_remote_desktop
15 KSPVERSION=0.5
16
17 trap onexit ERR
18
19 function onexit {
20 # Log an error but don't report an install failure if this script has errors.
21 logger An error occurred while launching the service
22 exit 0
23 }
24
25 # Update owner and permissions for auth file.
26 chown $USER "$AUTH_FILE"
27 chmod 600 "$AUTH_FILE"
28
29 # Load the service.
30 # The launchctl command we'd like to run:
31 # launchctl load -w -S Aqua $PLIST
32 # However, since we're installing as an admin, the launchctl command is run
33 # as if it had a sudo prefix, which means it tries to load the service in
34 # system rather than user space.
35 # To launch the service in user space, we need to get the current user (using
36 # ps and grepping for the loginwindow.app) and run the launchctl cmd as that
37 # user (using launchctl bsexec).
38 set `ps aux | grep loginwindow.app | grep -v grep`
39 # At this point, $1=username and $2=userid
40 if [[ -n $1 && -n $2 ]]; then
41 launchctl bsexec "$2" sudo -u "$1" launchctl load -w -S Aqua $PLIST
42 fi
43
44 # Register a ticket with Keystone so we're updated.
45 $KSADMIN --register --productid $KSPID --version $KSPVERSION --xcpath $PLIST --u rl $KSUPDATE
OLDNEW
« 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