#!/bin/bash
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
NAME="Age Of Empires II: The Age of Kings"
PREFIX="AOE2"
WINE="1.1.42"
wget http://upload.wikimedia.org/wikipedia/en/thumb/5/56/Age_of_Empires_II_-_The_Age_of_Kings_Coverart.png/250px-Age_of_Empires_II_-_The_Age_of_Kings_Coverart.png --output-document="$REPERTOIRE/tmp/leftnotscaled.jpeg"
convert "$REPERTOIRE/tmp/leftnotscaled.jpeg" -scale 150x356\\! "$REPERTOIRE/tmp/left.jpeg"
POL_SetupWindow_Init "" "$REPERTOIRE/tmp/left.jpeg"
if [ "$POL_LANG" == "it" ]; then
INSTALLATION="Sto installando $NAME ..."
POLEND="$NAME è stato installato con successo"
DOWNLOAD="Sto scaricando un aggiornamento/una patch per $NAME, attendi un momento..."
UPDATE="Age2upA-ITL.exe"
NEXT="Clicca su avanti solo quando è finita l'installazione"
else
INSTALLATION="Installing $NAME..."
POLEND="$NAME has been installed succesfully"
DOWNLOAD="Downloading an update/patch for $NAME, please wait..."
UPDATE="Age2upA.exe"
NEXT="Click on Forward only if the install is finished"
DWNOCD="Do you want to install nocd-crack? /nIf you do it the game will be more fluent"
fi
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "aoesetup.exe"
POL_SetupWindow_install_wine $WINE
Use_WineVersion $WINE
select_prefix "$HOME/.PlayOnLinux/wineprefix/$PREFIX/"
POL_SetupWindow_prefixcreate
PROGRAMFILES="Program Files"
POL_LoadVar_PROGRAMFILES
POL_SetupWindow_wait_next_signal "$INSTALLATION" "$NAME"
wine "$CDROM/aoesetup.exe"
POL_SetupWindow_message "$NEXT"
cd "$REPERTOIRE/tmp/"
POL_SetupWindow_download "$DOWNLOAD" "$NAME" "$DLUPDATE"
POL_SetupWindow_wait_next_signal "$INSTALLATION" "$NAME"
wine "$UPDATE"
POL_SetupWindow_detect_exit
POL_SetupWindow_reboot
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Microsoft Games/Age of Empires II" "empires2.exe" "" "$NAME"
Set_WineVersion_Assign $WINE "$NAME"
clean_tmp
POL_SetupWindow_message "$POLEND" "$NAME"
POL_SetupWindow_Close