#!/bin/bash
if [ "$PLAYONLINUX" = "" ]
then
exit 0
fi
source "$PLAYONLINUX/lib/sources"
cfg_check
if [ "$POL_LANG" == "fr" ]; then
LNG_ETH2_UPDATE_WELCOME="Bienvenue dans le script d'installation du patch 1.03 pour Etherlords II"
LNG_ETH2_UPDATE_INFO1="Je vais télécharger le patch sur le site officiel.\nCette opération peut nécessiter du temps.\nCliquez sur valider pour commencer."
LNG_ETH2_UPDATE_DL="Patientez pendant le téléchargement du patch...\nCette opération peut prendre quelques minutes selon la vitesse de votre connexion."
LNG_ETH2_UPDATE_FINISHED="Le patch a été correctement installé"
else
LNG_ETH2_UPDATE_WELCOME="Welcome in the patch 1.03 Installation script for Etherlords II"
LNG_ETH2_UPDATE_INFO1="I will download the path on the official website.\nThis opération may take time.nClick to begin."
LNG_ETH2_UPDATE_DL="Wait while the patch is downloading...\nThis operation can take time, depending of you connexion."
LNG_ETH2_UPDATE_FINISHED="Patch installed successfully"
fi
cd $REPERTOIRE/tmp
rm *.jpg
wget $SITE/setups/etherlords2/left.jpg
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpg"
POL_SetupWindow_message "$LNG_ETH2_UPDATE_WELCOME" "Etherlords 2"
POL_SetupWindow_checkexist()
{
if [ ! -e $REPERTOIRE/wineprefix/$1 ]; then
if [ "$POL_LANG" == "fr" ]; then
LNG_PREFIX_NOT_EXIST="Le jeu n'est pas installé."
else
LNG_PREFIX_NOT_EXIST="Game is not installed."
fi
POL_SetupWindow_message_image "$LNG_PREFIX_NOT_EXIST" "Prefix Checker" "$PLAYONLINUX/themes/tango/warning.png"
exit
fi
}
POL_SetupWindow_checkexist "Etherlords2"
select_prefixe "$REPERTOIRE/wineprefix/Etherlords2/"
POL_SetupWindow_message "$LNG_ETH2_UPDATE_INFO1" "Etherlords 2"
cd $REPERTOIRE/tmp
if [ "$POL_LANG" == "fr" ]; then
POL_SetupWindow_download "$LNG_ETH2_UPDATE_DL" "Etherlords 2" "http://www.dcegames.com/support/patchs/ETH2_PATCH_1.03_FR.exe"
wine ETH2_PATCH_1.03_FR.exe
rm ETH2_PATCH_1.03_FR.exe
else
POL_SetupWindow_download "$LNG_ETH2_UPDATE_DL" "Etherlords 2" "http://www.strategyfirst.ca/downloads/patches/etherlords2_patch_103_us.zip"
unzip etherlords2_patch_103_us.zip
wine EL2_103ENG.EXE
rm EL2_103ENG.EXE
fi
POL_SetupWindow_message "$LNG_ETH2_UPDATE_FINISHED" "Etherlords 2"
POL_SetupWindow_Close
exit