Magic number : 134
#!/bin/bash
# Date : (2009-06-16 20-00)
# Last revision : (2009-06-16 20-00)
# Wine version used : N/A
# Distribution used to test : N/A
# Author : NSLW
# Licence : Retail
#Translated from V2 to V3
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
#fetching PROGRAMFILES environmental variable
PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%"`
PROGRAMFILES=${PROGRAMFILES:3}
if [ "$POL_LANG" == "fr" ]; then
SUBTITLE="l'Ame du Guerrier"
elif [ "$POL_LANG" == "it" ]
then
SUBTITLE="Spirito Guerriero"
elif [ "$POL_LANG" == "es" ]
then
SUBTITLE="El Alma del Guerrero"
elif [ "$POL_LANG" == "pl" ]
then
SUBTITLE="Dusza wojownika"
else
SUBTITLE="Warrior Within"
fi
TITLE="Prince Of Persia - $SUBTITLE"
PREFIX="PoP-WarriorWithin"
wget http://upload.wikimedia.org/wikipedia/en/6/6f/Prince_of_Persia_-_Warrior_Within_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"
POL_SetupWindow_presentation "$TITLE" "Ubisoft" "http://www.princeofpersiagame.com" "GNU_Raziel and NSLW" "$PREFIX"
#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
cd "$REPERTOIRE/ressources/"
#determining which Version is the latest
wget http://mulx.playonlinux.com/wine/linux-i386/LIST --output-document=LIST
cat LIST | sed -e 's/\.//g' | cut -d';' -f2 | sort -n | tail -n1 >& LatestVersion.txt
x=`cat LatestVersion.txt | cut -c1-1`
y=`cat LatestVersion.txt | cut -c2-2`
z=`cat LatestVersion.txt | cut -c3-4`
LATESTVERSION=$x.$y.$z
CHOSENWINEVERSION="$LATESTVERSION"
POL_SetupWindow_install_wine "$CHOSENWINEVERSION"
Use_WineVersion "$CHOSENWINEVERSION"
select_prefix "$REPERTOIRE/wineprefix/$PREFIX"
POL_SetupWindow_prefixcreate
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "setup.exe"
#adding CD-ROM as drive d: to winecfg
CDROM2=${CDROM//"1"/"2"} #POP_DISC2
CDROM3=${CDROM//"1"/"3"} #POP_DISC3
cd "$WINEPREFIX/dosdevices"
ln -s $CDROM d:
ln -s $CDROM2 e:
ln -s $CDROM3 f:
cd "$WINEPREFIX/drive_c/windows/temp/"
echo "[HKEY_LOCAL_MACHINE\\Software\\Wine\\Drives]" > cdrom.reg
echo "\"d:\"=\"cdrom\"" >> cdrom.reg
echo "\"e:\"=\"cdrom\"" >> cdrom.reg
echo "\"f:\"=\"cdrom\"" >> cdrom.reg
regedit cdrom.reg
sleep 5
cd "$REPERTOIRE/ressources"
#downloading winetricks
if [ "`sha1sum < winetricks | sed 's/ .*//'`" != "bf24bc6d84a40a836d7ce6de41ff04f910b34434" ]; then
wget http://winezeug.googlecode.com/svn/trunk/winetricks --output-document=winetricks
fi
WINETRICKSDX=`cat winetricks | grep \/directx | cut -d'_' -f2`
WINETRICKSDXLINK=`cat winetricks | grep \/directx | cut -d'/' -f5,6,7,8`
#downloading DirectX
if [ ! -e "$HOME/.winetrickscache/directx_${WINETRICKSDX}_redist.exe" ]; then
mkdir "$HOME/.winetrickscache"
cd "$HOME/.winetrickscache"
POL_SetupWindow_download "$LNG_DX9_DL" "$TITLE" "http://download.microsoft.com/download/$WINETRICKSDXLINK/directx_${WINETRICKSDX}_redist.exe"
fi
#modyfing winetricks
cd "$WINEPREFIX/drive_c/windows/temp"
cat "$REPERTOIRE/ressources/winetricks" | sed -e 's/set_winver\ win2k/set_winver\ winxp/' > winetricks
#installing DirectX
POL_SetupWindow_wait_next_signal "$LNG_DX9_INSTALL" "$TITLE"
bash winetricks -q directx9 xact
POL_SetupWindow_detect_exit
Set_OS "winxp"
fonts_to_prefix
#starting installation
cd $CDROM
wine "setup.exe"
POL_SetupWindow_message "$LNG_WAIT_END" "$TITLE"
Set_Managed "On"
Set_DXGrab "On"
POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Ubisoft/Prince of Persia $SUBTITLE" "PrinceOfPersia.exe" "PoP-WarriorWithin.xpm" "$TITLE" "" ""
Set_WineVersion_Assign "$CHOSENWINEVERSION" "Prince Of Persia $SUBTITLE"
POL_SetupWindow_reboot
POL_SetupWindow_message "$TITLE has been installed successfully" "$TITLE"
POL_SetupWindow_Close
exit
#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"
#elif [ "$POL_LANG" == "it_IT.UTF-8" ]
#then
#creer_lanceur "PoP-WarriorWithin" "Program Files/Ubisoft/Prince of Persia Spirito Guerriero" "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