3 # Copy wordlists to SpeakGoodChinese preferences directory
4 if [[ `uname` == "Darwin" ]] ; then
5 APPLICATIONPATH
=`dirname "$0"`
6 cd "${APPLICATIONPATH}"
7 if [[ ${APPLICATIONPATH} =~
"Mac_install.app/Contents/Resources/Scripts" ]]; then
10 if [[ -d ~
/Desktop
/SpeakGoodChinese2_32.app
]]; then
11 osascript
-e 'tell app "Finder" to display dialog "SpeakGoodChinese2_32.app already exists at destination"'
12 elif [[ -s .
/SGC
2/SpeakGoodChinese2_32.app.
zip ]]; then
13 unzip .
/SGC
2/SpeakGoodChinese2_32.app.
zip -d ~
/Desktop
/
14 if [[ $?
!= 0 ]]; then
15 osascript
-e 'tell app "Finder" to display dialog "Installation of SpeakGoodChinese2_32.app encountered an error"'
18 mkdir
-p ~
/Library
/Preferences
/SpeakGoodChinese
2/wordlists
19 echo `pwd` >> ~
/Desktop
/kanweg.txt
20 cp -r wordlists
/* ~
/Library
/Preferences
/SpeakGoodChinese
2/wordlists
/
21 if [[ $?
== 0 ]]; then
22 osascript
-e 'tell app "Finder" to display dialog "Installation completed"'
24 osascript
-e 'tell app "Finder" to display dialog "Installation of wordlists encountered an error"'
27 echo "THIS INSTALL SCRIPT IS ONLY FOR MACINTOSH COMPUTERS (OSX)"
28 osascript
-e 'tell app "Finder" to display dialog "THIS INSTALL SCRIPT IS ONLY FOR MACINTOSH COMPUTERS (OSX)"'
30 osascript
-e 'tell application "Terminal" to quit'