Changed name of SGC app in installer
[sgc2.git] / addons / Mac_install.command
blob679453f65ce6e4b1c5ff0d574d30558a9efc5dd3
1 #!/bin/bash
2 #
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
8 cd ../../../../
9 fi
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 ./SGC2/SpeakGoodChinese2_32.app.zip ]]; then
13 unzip ./SGC2/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/SpeakGoodChinese2/wordlists
19 cp -r wordlists/* ~/Library/Preferences/SpeakGoodChinese2/wordlists/
20 if [[ $? == 0 ]]; then
21 osascript -e 'tell app "Finder" to display dialog "Installation completed"'
22 else
23 osascript -e 'tell app "Finder" to display dialog "Installation of wordlists encountered an error"'
25 else
26 echo "THIS INSTALL SCRIPT IS ONLY FOR MACINTOSH COMPUTERS (OSX)"
27 osascript -e 'tell app "Finder" to display dialog "THIS INSTALL SCRIPT IS ONLY FOR MACINTOSH COMPUTERS (OSX)"'
29 osascript -e 'tell application "Terminal" to quit'
30 exit 0