The forum

Prince of Persia - Sands of Time (improved)

Author Replies
mablanco Monday 20 October 2008 at 18:41

Hello there. The original script for "Prince of Persia - Sands of Time" did not work for me, mainly because my two CDs have different names, something that the original script seems to rely on to work. Therefore, I've modified the script so it now checks that the correct 2nd CD is inserted. As I was modifying the script, I decided to make several additional improvements. This is the complete list:

- The script now checks that the correct 2nd CD is inserted before proceeding to copy its contents
- Added link removal to d: before creating it for first time in the script (there are Linux distros that seem to ignore -f switch of the ln command when the link already exists)
- Now every message string in the script can be translated
- The script now supports more than two languages
- Added Spanish translation
- Made sure that game is installed in "Archivos de programa" (Program files in spanish) under a spanish environment

That's all! Now, here is the script:

if [ "$PLAYONLINUX" = "" ]
exit 0
source "$PLAYONLINUX/lib/sources"

presentation "Prince Of Persia - Sands Of Time" "Ubisoft" "" "GNU_Raziel (improved by mablanco)" "PoP-SandsOfTime" 1 11

case "$POL_LANG" in
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."
LNG_PAT_INST="Patientez pendant la pr_paration de l'installation ..."
LNG_DX9_DL="Descargando actualización DirectX9.0c para Wine..."
LNG_XINPUT_DL="Descargando actualizaciones Xinput y XACT para Wine..."
LNG_DX9_INSTALL="La instalación de la actualización DirectX9.0c para Wine va a comenzar."
LNG_XINPUT_INSTALL="La instalación de Xinput y XACT para Wine va a comenzar."
LNG_WAIT_END="Pulse en "Siguiente" SOLO cuando la instalación del juego haya finalizado o tendrá que rehacer la instalación."
LNG_PAT_INST="Por favor, espere mientras se prepara la instalación..."
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."
LNG_PAT_INST="Please wait while the installation is getting ready..."

Ask_For_cdrom 2 11
Check_cdrom "setup.exe"

chmod 777 $TEMP -R
rm $TEMP -R
mkdir $TEMP
mkdir -p $REPERTOIRE/wineprefix/PoP-SandsOfTime
cd $REPERTOIRE/wineprefix/PoP-SandsOfTime
select_prefixe "$(pwd)"
creer_prefixe 3 11

cd $WINEPREFIX/drive_c/windows/
mkdir temp
cd $WINEPREFIX/dosdevices
rm ./d:
ln -s $TEMP ./d:

attendre "$LNG_PAT_INST" "cp -r $CDROM/* $TEMP" "" 4 11
chmod 777 $TEMP -R
ask_mount_num 2
Ask_For_cdrom 5 11
Check_cdrom "POP.exe"
attendre "$LNG_PAT_INST" "cp -r $CDROM/* $TEMP" "" 6 11
chmod 777 $TEMP -R

if [ ! -e $REPERTOIRE/tmp/ ]; then
telecharger "$LNG_DX9_DL" "" 7 11
if [ ! -e $REPERTOIRE/tmp/ ]; then
telecharger "$LNG_XINPUT_DL" "" 8 11
cd $WINEPREFIX/drive_c/windows/temp/
unzip $REPERTOIRE/tmp/
unzip $REPERTOIRE/tmp/
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

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

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

case "$POL_LANG" in
creer_lanceur "PoP-SandsOfTime" "Program Files/UBISOFT/Prince of Persia Les Sables du Temps" "PrinceOfPersia.EXE" "PoP-SandsOfTime.xpm" "Prince Of Persia - Les Sables Du Temps"
creer_lanceur "PoP-SandsOfTime" "Archivos de programa/UBISOFT/Prince of Persia Las Arenas del Tiempo" "PrinceOfPersia.EXE" "PoP-SandsOfTime.xpm" "Prince Of Persia - Las Arenas del Tiempo"
creer_lanceur "PoP-SandsOfTime" "Program Files/UBISOFT/Prince of Persia Sands of Time" "PrinceOfPersia.EXE" "PoP-SandsOfTime.xpm" "Prince Of Persia - Sands Of Time"