d2-setup.sh: error handling and help
This commit is contained in:
parent
e0156f36d9
commit
9774c9bccb
53
d2-setup.sh
53
d2-setup.sh
@ -1,23 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
echo "NOTICE: Currently you must move & rename the installer directories to the following:"
|
||||
echo "Base Game: ${HOME}/D2"
|
||||
echo "Expansion: ${HOME}/LOD"
|
||||
echo "Then run this script with the following option:"
|
||||
echo "${0} -a"
|
||||
echo "The script will then kick off the process of grabbing debs, setting the prefix and installing the game."
|
||||
echo "User intervention is required to click through the installer setups"
|
||||
# Colors
|
||||
RED='\033[0;31m'
|
||||
LRED="\033[1;31m"
|
||||
BLUE="\033[0;34m"
|
||||
LBLUE="\033[1;34m"
|
||||
GREEN="\033[0;32m"
|
||||
LGREEN="\033[1;32m"
|
||||
YELLOW="\033[1;33m"
|
||||
CYAN="\033[0;36m"
|
||||
LCYAN="\033[1;36m"
|
||||
PURPLE="\033[0;35m"
|
||||
LPURPLE="\033[1;35m"
|
||||
BWHITE="\e[1m"
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Wine Prefix Environment
|
||||
PREFIX="/home/$USER/diablo"
|
||||
ARCH="win32"
|
||||
|
||||
|
||||
notice(){
|
||||
echo -e "${YELLOW}NOTICE: Currently you must move & rename the installer directories to the following: ${NC}\n"
|
||||
echo -e "${LCYAN}Base Game: ${HOME}/D2${NC}"
|
||||
echo -e "${LCYAN}Expansion: ${HOME}/LOD${NC}"
|
||||
echo -e "${YELLOW}\nThen run this script with the following option:${NC}"
|
||||
echo -e "${LCYAN}${0} -a${NC}"
|
||||
echo -e "${YELLOW}\nThe script will then kick off the process of grabbing debs, setting the prefix and installing the game.${NC}"
|
||||
echo -e "${YELLOW}User intervention is required to click through the installer setups${NC}"
|
||||
}
|
||||
|
||||
installD2(){
|
||||
notice
|
||||
read -n 1 -p "~~~~~~ Press enter to continue ~~~~~~"
|
||||
|
||||
D2_INSTALLER_PATH="/home/$USER/D2"
|
||||
|
||||
echo -e "\nInstalling Diablo II...\n"
|
||||
echo -e "\n${LGREEN}Installing Diablo II...${NC}\n"
|
||||
|
||||
if [ ! -d "${D2_INSTALLER_PATH}" ];then
|
||||
echo -e "${D2_INSTALLER_PATH} not found, edit script and set correct path\n"
|
||||
@ -31,6 +56,10 @@ installD2(){
|
||||
}
|
||||
|
||||
installLOD(){
|
||||
|
||||
notice
|
||||
read -n 1 -p "~~~~~~ Press enter to continue ~~~~~~"
|
||||
|
||||
LOD_INSTALLER_PATH="/home/$USER/LOD"
|
||||
|
||||
echo -e "\nInstalling Diablo II: Lord of Destruction...\n"
|
||||
@ -91,11 +120,11 @@ getGlide(){
|
||||
}
|
||||
runGame(){
|
||||
|
||||
cd "${PREFIX}/drive_c/"Program Files"/"Diablo II"/" || exit 1
|
||||
cd "${PREFIX}/drive_c/Program Files/Diablo II/" || exit 1
|
||||
|
||||
|
||||
echo -n -e "\nRun game now?(Y/n): "
|
||||
read choice
|
||||
echo -n -e "\n${LGREEN}Run game now?(Y/n): ${NC}"
|
||||
read -r choice
|
||||
|
||||
if [ "${choice}" = "n" ];then
|
||||
exit 0;
|
||||
@ -109,7 +138,7 @@ runGame(){
|
||||
run_glide(){
|
||||
|
||||
|
||||
cd "${PREFIX}/drive_c/"Program Files"/"Diablo II"/" || exit 1
|
||||
cd "${PREFIX}/drive_c/Program Files/Diablo II/" || exit 1
|
||||
|
||||
|
||||
WINEPREFIX="${PREFIX}" WINEARCH="${ARCH}" wine "glide-init.exe"
|
||||
|
Loading…
x
Reference in New Issue
Block a user