From 9f34fa0983ee9f93143a743bb8cfba0256dae675 Mon Sep 17 00:00:00 2001 From: Rob van Son Date: Tue, 10 Feb 2015 14:38:10 +0100 Subject: [PATCH] Updated Linux install script --- addons/Linux_install.sh | 18 +++++++++++------- addons/Mac_install.command | 4 ++-- addons/Windows_install.bat | 4 ++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/addons/Linux_install.sh b/addons/Linux_install.sh index 6b0c6a8..19d62c8 100755 --- a/addons/Linux_install.sh +++ b/addons/Linux_install.sh @@ -4,20 +4,24 @@ ZENITY=`which zenity` if [[ `/bin/uname` != "Darwin" ]] ; then cd "`dirname "$0"`" - if [[ -s "~/Desktop/SpeakGoodChinese2" && -n ZENITY ]]; then + MACHINE="32" + if [[ `/bin/uname -m` =~ "64" ]]; then + MACHINE="64" + fi + if [[ (-s ~/Desktop/SpeakGoodChinese2 || -s ~/SpeakGoodChinese2) && -n ZENITY ]]; then zenity --info --text="SpeakGoodChinese2 already exists at destination" - elif [[ -s "./SGC2/SpeakGoodChinese2_Linux64.zip" ]]; then - if [[ -d "~/Desktop" ]]; then - unzip ./SGC2/SpeakGoodChinese2_Linux64.zip -d ~/Desktop/ + elif [[ -s ./SGC2/SpeakGoodChinese2_linux${MACHINE}.zip ]]; then + if [[ -d ~/Desktop ]]; then + unzip ./SGC2/SpeakGoodChinese2_linux${MACHINE}.zip -d ~/Desktop/ else - unzip ./SGC2/SpeakGoodChinese2_Linux64.zip -d ~/SpeakGoodChinese2 + unzip ./SGC2/SpeakGoodChinese2_linux${MACHINE}.zip -d ~/ fi if [[ $? != 0 && -n ZENITY ]]; then zenity --info --text='Installation of SpeakGoodChinese2 encountered an error' fi fi - mkdir -p "~/.SpeakGoodChinese2/wordlists" - cp -r wordlists/* "~/.SpeakGoodChinese2/wordlists/" + mkdir -p ~/.SpeakGoodChinese2/wordlists + cp -r wordlists/* ~/.SpeakGoodChinese2/wordlists/ if [[ $? != 0 && -n ZENITY ]]; then zenity --info --text='Installation of the wordlists encountered an error' elif [[ -n ZENITY ]]; then diff --git a/addons/Mac_install.command b/addons/Mac_install.command index e731d1c..ff6821b 100755 --- a/addons/Mac_install.command +++ b/addons/Mac_install.command @@ -5,8 +5,8 @@ if [[ `uname` == "Darwin" ]] ; then cd "`dirname "$0"`" if [[ -d ~/Desktop/SpeakGoodChinese2.app ]]; then osascript -e 'tell app "Finder" to display dialog "SpeakGoodChinese2.app already exists at destination"' - elif [[ -s ./SGC2/SpeakGoodChinese2_Mac.app.zip ]]; then - unzip ./SGC2/SpeakGoodChinese2_Mac.app.zip -d ~/Desktop/ + elif [[ -s ./SGC2/SpeakGoodChinese2.app.zip ]]; then + unzip ./SGC2/SpeakGoodChinese2.app.zip -d ~/Desktop/ if [[ $? != 0 ]]; then osascript -e 'tell app "Finder" to display dialog "Installation of SpeakGoodChinese2.app encountered an error"' fi diff --git a/addons/Windows_install.bat b/addons/Windows_install.bat index 9b0cec4..e498500 100644 --- a/addons/Windows_install.bat +++ b/addons/Windows_install.bat @@ -1,7 +1,7 @@ cd "%~dp0" -if EXIST SGC2\SpeakGoodChinese2_Windows.exe ( +if EXIST SGC2\SpeakGoodChinese2.exe ( if NOT EXIST "%HOMEDRIVE%%HOMEPATH%\Desktop\SpeakGoodChinese2.exe" ( - copy SGC2\SpeakGoodChinese2_Windows.exe "%HOMEDRIVE%%HOMEPATH%\Desktop\SpeakGoodChinese2.exe" + copy SGC2\SpeakGoodChinese2.exe "%HOMEDRIVE%%HOMEPATH%\Desktop\SpeakGoodChinese2.exe" if ERRORLEVEL 1 ( msg "%username%" Installation of SpeakGoodChinese.exe encountered an error ) -- 2.11.4.GIT