#!/bin/bash
if [ "$PLAYONLINUX" = "" ]
then
exit 0
fi
source "$PLAYONLINUX/lib/sources"
cfg_check
if [ "$POL_LANG" == "fr" ]; then
LNG_MP2_UPDATE_WELCOME="Bienvenue dans le script d'installation du patch 1.01 pour Max Payne 2"
LNG_MP2_UPDATE_INFO="Ce patch ajoute 2 niveaux supplémentaires\n disponibles dans le mode \"Dead Man Walking\"."
LNG_MP2_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_MP2_UPDATE_DL="Patientez pendant le téléchargement du patch...\nCette opération peut prendre quelques minutes selon la vitesse de votre connexion."
LNG_MP2_UPDATE_INSTALL="Téléchargement terminé. Installation du patch."
LNG_MP2_UPDATE_FINISHED="Le patch à été correctement installé."
else
LNG_MP2_UPDATE_WELCOME="Welcome in the patch 1.01 Installation script for Max Payne 2"
LNG_MP2_UPDATE_INFO="This patch add two new levels for the \"Dead Man Walking\" Mode."
LNG_MP2_UPDATE_INFO1="I will download the path on the official website.\nThis opération may take time.\nClick to begin."
LNG_MP2_UPDATE_DL="Wait while the patch is downloading...\nThis operation can take time, depending of you connexion."
LNG_MP2_UPDATE_INSTALL="Donwload finished. Patch installation will begin."
LNG_MP2_UPDATE_FINISHED="Patch installed successfully."
fi
cd $REPERTOIRE/tmp
rm *.jpg
wget $SITE/setups/maxpayne2/left.jpg
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpg"
POL_SetupWindow_message "$LNG_MP2_UPDATE_WELCOME" "Max Payne 2 : The Fall of Max Payne"
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="This 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 "MaxPayne2"
select_prefixe "$REPERTOIRE/wineprefix/MaxPayne2/"
POL_SetupWindow_message "$LNG_MP2_UPDATE_INFO" "Max Payne 2 : The Fall of Max Payne"
POL_SetupWindow_message "$LNG_MP2_UPDATE_INFO1" "Max Payne 2 : The Fall of Max Payne"
cd $REPERTOIRE/tmp
POL_SetupWindow_download "$LNG_MP2_UPDATE_DL" "Max Payne 2 : The Fall of Max Payne" "http://www.rockstargames.com/maxpayne2/downloads/MaxPayne2BonusChapters.zip"
unzip MaxPayne2BonusChapters.zip
wine MaxPayne2BonusChapters.exe
rm MaxPayne2BonusChapters.zip
rm MaxPayne2BonusChapters.exe
rm readme.txt
POL_SetupWindow_message "$LNG_MP2_UPDATE_FINISHED" "Max Payne 2 : The Fall of Max Payne"
POL_SetupWindow_Close
exit