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

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 HELPERTOOLS=/Library/PrivilegedHelperTools
4 NAME=org.chromium.chromoting
5 AUTH_FILE="$HELPERTOOLS/$NAME.json"
6 PLIST=/Library/LaunchAgents/org.chromium.chromoting.plist
7
8 KSADMIN=/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Content s/MacOS/ksadmin
9 KSUPDATE=https://tools.google.com/service/update2
10 KSPID=com.google.chrome_remote_desktop
11 KSPVERSION=0.5
12
13 trap onexit ERR
14
15 function onexit {
16 # Log an error but don't report an install failure if the script has errors.
17 logger An error occurred while launching the service
18 exit 0
19 }
20
21 # Update owner and permissions for auth file.
22 sudo chown $USER "$AUTH_FILE"
23 sudo chmod 600 "$AUTH_FILE"
24
25 # Load the service.
26 # The launchctl command we'd like to run:
27 # launchctl load -w -S Aqua $PLIST
28 # However, since we're installing as an admin, the launchctl command is run
Lambros 2012/04/03 00:49:17 If we're installing as an admin, do we need "sudo"
garykac 2012/04/09 19:04:16 I verified that they're not needed when inside the
29 # as if it had a sudo prefix, which means it tries to load the service in
30 # system rather than user space.
31 # To launch the service in user space, we need to get the current user (using
32 # ps and grepping for the loginwindow.app) and run the launchctl cmd as that
33 # user (using launchctl bsexec).
34 set `ps aux | grep loginwindow.app | grep -v grep`
35 # At this point, $1=username and $2=userid
36 if [[ -n $1 && -n $2 ]]; then
37 sudo launchctl bsexec "$2" sudo -u "$1" launchctl load -w -S Aqua $PLIST
38 fi
39
40 # Register a ticket with Keystone so we're updated.
41 $KSADMIN --register --productid $KSPID --version $KSPVERSION --xcpath $PLIST --u rl $KSUPDATE
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698