-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathinstall.command
executable file
·32 lines (25 loc) · 1.06 KB
/
install.command
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
basepath=$(cd `dirname $0`; pwd)
$basepath/uninstall.command
mkdir -p ~/Library/LaunchAgents
cat $basepath/cn.xueguoliang.dscap.plist | sed "s#\~#$HOME#" > ~/Library/LaunchAgents/cn.xueguoliang.dscap.plist
cat $basepath/cn.xueguoliang.dssend.plist | sed "s#\~#$HOME#" > ~/Library/LaunchAgents/cn.xueguoliang.dssend.plist
rm -rf ~/Library/DS
mkdir ~/Library/DS
cp -R $basepath/DSCap.app ~/Library/DS
cp -R $basepath/DSSend.app ~/Library/DS
rm -rf /Applications/DS.app
rm -rf ~/Applications/DS.app
cp -R $basepath/DS.app ~/Applications
rm -rf /Applications/DSView.app
rm -rf ~/Applications/DSView.app
cp -R $basepath/DSView.app ~/Applications
if [ -f "~/Library/LaunchAgents/cn.xueguoliang.dscap.plist" ]; then
launchctl unload ~/Library/LaunchAgents/cn.xueguoliang.dscap.plist
fi
if [ -f "~/Library/LaunchAgents/cn.xueguoliang.dssend.plist" ]; then
launchctl unload ~/Library/LaunchAgents/cn.xueguoliang.dssend.plist
fi
sleep 1
launchctl load ~/Library/LaunchAgents/cn.xueguoliang.dscap.plist
launchctl load ~/Library/LaunchAgents/cn.xueguoliang.dssend.plist