Scripts

Script for Prince Of Persia - Warrior Within

#!/bin/bash
if [ "$PLAYONLINUX" = "" ]
then
exit 0
fi
source "$PLAYONLINUX/lib/sources"
cfg_check

presentation "Prince Of Persia - Warrior Within" "Ubisoft" "http://www.princeofpersiagame.com/" "GNU_Raziel" "PoP-WarriorWithin" 1 11

if [ "$POL_LANG" == "fr_FR.UTF-8" ]; then
LNG_POP_VERSION="Quelle version de Prince Of Persia possédez vous ?"
LNG_DX9_DL="Téléchargement de la mise a jour DirectX9.0c pour Wine..."
LNG_XINPUT_DL="Téléchargement de la mise a jour Xinput et XACT pour Wine..."
LNG_DX9_INSTALL="L'installation de la mise a jour DirectX9.0c pour Wine va débuter."
LNG_XINPUT_INSTALL="L'installation de la mise a jour Xinput et XACT pour Wine va débutée."
LNG_WAIT_END="Appuyez sur "Suivant" UNIQUEMENT quand l'installation du jeu sera terminée sous peine de devoir recommencer l'installation."
else
LNG_POP_VERSION="Which version of Prince Of Persia do you have ?"
LNG_DX9_DL="Downloading Wine DirectX9.0c Update..."
LNG_XINPUT_DL="Downloading Wine Xinput and XACT Update..."
LNG_DX9_INSTALL="DirectX9.0c Update installation will begin."
LNG_XINPUT_INSTALL="Xinput and XACT installation will begin."
LNG_WAIT_END="Click on "Next" ONLY when the game installation is finished or you will have to redo the installation."
fi

Ask_For_cdrom 2 11
Check_cdrom "setup.exe"

TEMP="$HOME/.PlayOnLinux/tmp/PoP-WarriorWithin"
chmod 777 $TEMP -R
rm $TEMP -R
mkdir $TEMP
mkdir -p $REPERTOIRE/wineprefix/PoP-WarriorWithin
cd $REPERTOIRE/wineprefix/PoP-WarriorWithin
select_prefixe "$(pwd)"
creer_prefixe 3 11

cd $WINEPREFIX/drive_c/windows/
mkdir temp
cd $WINEPREFIX/dosdevices
version_pop=$(menu "$LNG_POP_VERSION" "3 CD~1 DVD" "Prince Of Persia - Warrior Within" 4 11 1 "" "~")
if [ "$?" = "1" ]
then
exit
fi

if [ "$version_pop" = "3 CD" ]
then
ln -sf $TEMP ./d:

attendre "Patientez pendant la préparation de l'installation ..." "cp -r $CDROM/* $TEMP" "" 4 11
chmod 777 $TEMP -R
ask_mount_num 2
attendre "Patientez pendant la préparation de l'installation ..." "cp -r $CDROM/* $TEMP" "" 5 11
chmod 777 $TEMP -R
ask_mount_num 3
attendre "Patientez pendant la préparation de l'installation ..." "cp -r $CDROM/* $TEMP" "" 6 11
chmod 777 $TEMP -R
else
ln -sf $CDROM ./d:
fi

cd $REPERTOIRE/tmp/
if [ ! -e $REPERTOIRE/tmp/D3DX9_dll_update.zip ]; then
telecharger "$LNG_DX9_DL" http://www.threelights.de/page/projects/d3dx9_xx_dll_files/D3DX9_dll_update.zip "" 7 11
fi
if [ ! -e $REPERTOIRE/tmp/X_dll_update.zip ]; then
telecharger "$LNG_XINPUT_DL" http://www.threelights.de/page/projects/d3dx9_xx_dll_files/X_dll_update.zip "" 8 11
fi
cd $WINEPREFIX/drive_c/windows/temp/
unzip $REPERTOIRE/tmp/D3DX9_dll_update.zip
unzip $REPERTOIRE/tmp/X_dll_update.zip
message "$LNG_DX9_INSTALL" "" 9 11
Set_OS "winxp"
wine c:\\windows\\temp\\D3DX9_dll_update\\Install\\DXSETUP.exe
message "$LNG_XINPUT_INSTALL" "" 10 11
wine c:\\windows\\temp\\X_dll_update\\Install\\DXSETUP.exe

fonts_to_prefixe
wine d:\\setup.exe
message "$LNG_WAIT_END" "" 11 11

Set_Managed "On"
Set_DXGrab "On"
Set_GLSL "On"

cd $WINEPREFIX/dosdevices
rm ./d:
ln -s $CDROM ./d:
rm -rf $TEMP

simuler_reboot
rm -rf $WINEPREFIX/drive_c/windows/temp/*

if [ "$POL_LANG" == "fr_FR.UTF-8" ]; then
creer_lanceur "PoP-WarriorWithin" "Program Files/Ubisoft/Prince of Persia l'Ame du Guerrier" "PrinceOfPersia.exe" "PoP-WarriorWithin.xpm" "Prince Of Persia - Warrior Within"
else
creer_lanceur "PoP-WarriorWithin" "Program Files/Ubisoft/Prince of Persia Warrior Within" "PrinceOfPersia.exe" "PoP-WarriorWithin.xpm" "Prince Of Persia - Warrior Within"
fi

Set_WineVersion_Assign "0.9.54" "Prince Of Persia - Warrior Within"

end_install
exit