#!/bin/bash
[
"$PLAYONLINUX"
=
""
] &&
exit
0
source
"$PLAYONLINUX/lib/sources"
TYTUL=
"Age of Empires III - The Asian Dynasties"
PREFIX=
"AOE3"
PATCHVERSION=
"102"
patch_aoe3()
{
POL_SetupWindow_browse
"Select patch file"
"$TYTUL"
""
wine $APP_ANSWER
POL_SetupWindow_message
"Patch for $TYTUL has been installed successfully"
"$TYTUL"
}
Get_Latest_Wine_Version()
{
wget http:
//mulx
.playonlinux.com
/wine/linux-i386/LIST
--output-document=
"$REPERTOIRE/tmp/LIST"
xyz=`
cat
"$REPERTOIRE/tmp/LIST"
|
sed
-e
's/\\.//g'
|
cut
-d
';'
-f2 |
sort
-n |
tail
-n1`
echo
"$(echo $xyz | cut -c1-1).$(echo $xyz | cut -c2-2).$(echo $xyz | cut -c3-4)"
}
POL_SetupWindow_make_icon_for_shortcut()
{
convert
"$HOME/.local/share/icons/$2"
-geometry 32X32
"$REPERTOIRE/icones/32/$1"
}
wget http:
//upload
.wikimedia.org
/wikipedia/en/c/c7/Tad_box
.jpg --output-document=
"$REPERTOIRE/tmp/leftnotscaled.jpeg"
convert
"$REPERTOIRE/tmp/leftnotscaled.jpeg"
-scale 150x356\\!
"$REPERTOIRE/tmp/left.jpeg"
POL_SetupWindow_Init
""
"$REPERTOIRE/tmp/left.jpeg"
POL_SetupWindow_presentation
"$TYTUL"
"Ensemble Studios"
"www.ageofempires3.com"
"NSLW"
"$PREFIX"
select_prefix
"$REPERTOIRE/wineprefix/$PREFIX"
if
[ -e
"$REPERTOIRE/configurations/installed/$TYTUL"
];
then
POL_SetupWindow_menu
"What do you want to do?"
"Actions"
"Patch game"
"~"
if
[
"$APP_ANSWER"
==
"Patch game"
];
then
patch_aoe3
fi
POL_SetupWindow_Close
exit
fi
cd
"$REPERTOIRE/ressources/"
LATESTVERSION=$(Get_Latest_Wine_Version)
CHOSENWINEVERSION=
"$LATESTVERSION"
POL_SetupWindow_install_wine
"$CHOSENWINEVERSION"
Use_WineVersion
"$CHOSENWINEVERSION"
PROGRAMFILES=`wine cmd
/c
echo
"%ProgramFiles%"
`
PROGRAMFILES=${PROGRAMFILES:3}
POL_SetupWindow_message
"Please insert $TYTUL media into your disk drive."
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom
"Age of Empires III - The Asian Dynasties.msi"
POL_SetupWindow_wait_next_signal
"Installation in progress..."
"$TYTUL"
cd
"$CDROM"
CHECK=$(
find
. -iwholename .
/setup
.exe)
if
[
"$CHECK"
==
""
];
then
wine
"instalar.exe"
else
wine
"setup.exe"
fi
POL_SetupWindow_detect_exit
cd
"$WINEPREFIX/drive_c/windows/temp/"
POL_SetupWindow_make_shortcut
"$PREFIX"
"$PROGRAMFILES/Microsoft Games/Age of Empires III"
"age3y.exe"
""
"$TYTUL"
""
""
Set_WineVersion_Assign
"$CHOSENWINEVERSION"
"$TYTUL"
POL_SetupWindow_make_icon_for_shortcut
"$TYTUL"
"*_age3y.0.png"
cd
"$WINEPREFIX/drive_c/windows/temp/"
rm
-rf *
POL_SetupWindow_message
"$TYTUL has been installed successfully"
"$TYTUL"
killall IDriver.exe
killall setup.exe
POL_SetupWindow_question
"Do you want to patch your game?"
"$TYTUL"
if
[
"$APP_ANSWER"
==
"TRUE"
];
then
POL_SetupWindow_menu
"What installer should do?"
"Actions"
"Let me choose patch manually~Download patch automatically"
"~"
if
[
"$APP_ANSWER"
==
"Let me choose patch manually"
];
then
patch_aoe3
elif
[
"$APP_ANSWER"
==
"Download patch automatically"
]
then
POL_SetupWindow_menu
"What is your language version?"
"Languages"
"english~french~italian~german~spanish~brazilian~polish~japanese~korean~chinese~czech~hungarian~russian"
"~"
LANGUAGEVERSION=$APP_ANSWER
if
[
"$APP_ANSWER"
==
"english"
];
then
LANGUAGEVERSIONSHRT=
"EN"
elif
[
"$APP_ANSWER"
==
"french"
]
then
LANGUAGEVERSIONSHRT=
"FR"
elif
[
"$APP_ANSWER"
==
"italian"
]
then
LANGUAGEVERSIONSHRT=
"IT"
elif
[
"$APP_ANSWER"
==
"german"
]
then
LANGUAGEVERSIONSHRT=
"DE"
elif
[
"$APP_ANSWER"
==
"spanish"
]
then
LANGUAGEVERSIONSHRT=
"ES"
elif
[
"$APP_ANSWER"
==
"brazilian"
]
then
LANGUAGEVERSIONSHRT=
"BP"
elif
[
"$APP_ANSWER"
==
"polish"
]
then
LANGUAGEVERSIONSHRT=
"PL"
elif
[
"$APP_ANSWER"
==
"japanese"
]
then
LANGUAGEVERSIONSHRT=
"JP"
elif
[
"$APP_ANSWER"
==
"korean"
]
then
LANGUAGEVERSIONSHRT=
"KOR"
elif
[
"$APP_ANSWER"
==
"chinese"
]
then
LANGUAGEVERSIONSHRT=
"CHT"
elif
[
"$APP_ANSWER"
==
"czech"
]
then
LANGUAGEVERSIONSHRT=
"CZE"
elif
[
"$APP_ANSWER"
==
"hungarian"
]
then
LANGUAGEVERSIONSHRT=
"HU"
elif
[
"$APP_ANSWER"
==
"russian"
]
then
LANGUAGEVERSIONSHRT=
"RU"
fi
cd
"$REPERTOIRE/ressources"
if
[ ! -e
"aoe3y-$PATCHVERSION-${LANGUAGEVERSION}.exe"
];
then
POL_SetupWindow_download
"PlayOnLinux is downloading aoe3-$PATCHVERSION-${LANGUAGEVERSION}.exe"
"Downloading patch"
"http://aom.zone.com/MGS/ES/loc/patchy$PATCHVERSION/$LANGUAGEVERSIONSHRT/aoe3y-$PATCHVERSION-${LANGUAGEVERSION}.exe"
fi
POL_SetupWindow_wait_next_signal
"Installation in progress..."
"$TYTUL"
wine
"aoe3y-$PATCHVERSION-${LANGUAGEVERSION}.exe"
POL_SetupWindow_detect_exit
POL_SetupWindow_message
"Patch for $TYTUL has been installed successfully"
"$TYTUL"
fi
fi
POL_SetupWindow_message_image
"Enable V-Sync in game\\notherwise you won't be able to run game second time\\n(tip by Oisin O Malley)"
"Note about V-sync"
"$PLAYONLINUX/themes/tango/warning.png"
POL_SetupWindow_message_image
"Please note that this game has a copy protection system\\nand sadly, it prevents Wine from running the game.\\n\\nPlayOnLinux will not provide any help concerning any illegal\\nstuff."
"Note about copy protection"
"$PLAYONLINUX/themes/tango/warning.png"
POL_SetupWindow_Close
exit