#!/bin/bash
[
"$PLAYONLINUX"
=
""
] &&
exit
0
source
"$PLAYONLINUX/lib/sources"
TITLE=
"Prince of Persia : The Forgotten Sands"
TITLE_SETTINGS=
"Prince of Persia : The Forgotten Sands (Configuration)"
PREFIX=
"PoP-TFS"
EDITOR=
"Ubisoft"
AUTHOR=
"GNU_Raziel"
WORKING_WINE_VERSION=
"1.5.3-ubisoft2"
if
[
"$POL_LANG"
==
"fr"
];
then
TITLE=
"Prince of Persia : Les Sables Oublies"
TITLE_SETTINGS=
"Prince of Persia : Les Sables Oublies (Configuration)"
fi
POL_SetupWindow_Init
POL_Debug_Init
POL_SetupWindow_presentation
"$TITLE"
"$EDITOR"
"$GAME_URL"
"$AUTHOR"
"$PREFIX"
POL_Wine_SelectPrefix
"$PREFIX"
POL_System_SetArch
"x86"
POL_Wine_PrefixCreate
"$WORKING_WINE_VERSION"
POL_SetupWindow_InstallMethod
"DVD,STEAM,LOCAL"
if
[
"$INSTALL_METHOD"
==
"STEAM"
];
then
POL_Call
POL_Install_steam
fi
POL_Call
POL_Install_dxfullsetup
POL_Call
POL_Install_physx
POL_Call
POL_Install_ubigamelauncher
if
[
"$INSTALL_METHOD"
==
"DVD"
];
then
POL_SetupWindow_message
"$(eval_gettext 'Please insert the game media into your disk drive')"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom
"System/Prince of Persia.exe"
POL_Wine_WaitBefore
"$TITLE"
POL_Wine
start
/unix
"$CDROM/setup.exe"
POL_Wine_WaitExit
"$TITLE"
elif
[
"$INSTALL_METHOD"
==
"STEAM"
];
then
POL_SetupWindow_message
"$(eval_gettext 'When $TITLE download by Steam is finished,\nDo NOT click on Play.\n\nClose COMPLETELY the Steam interface, \nso that the installation script can continue.')"
"$TITLE"
cd
"$WINEPREFIX/drive_c/$PROGRAMFILES/Steam"
POL_SetupWindow_menu
"$(eval_gettext 'Which edition do you have?')"
"$TITLE"
"$(eval_gettext 'Normal version')~$(eval_gettext 'Digital Deluxe version')"
"~"
if
[
"$APP_ANSWER"
==
"$(eval_gettext 'Normal version')"
];
then
STEAM_ID=
"33320"
else
STEAM_ID=
"33329"
fi
POL_Call
POL_Install_steam_flags
"$STEAM_ID"
POL_Shortcut
"steam.exe"
"$TITLE"
"Prince of Persia : The Forgotten Sands.png"
"steam://rungameid/$STEAM_ID"
POL_Wine
start
/unix
"steam.exe"
steam:
//install/
$STEAM_ID
POL_Wine_WaitExit
"$TITLE"
else
cd
"$HOME"
POL_SetupWindow_browse
"$(eval_gettext 'Please select the setup file to run')"
"$TITLE"
SETUP_EXE=
"$APP_ANSWER"
POL_Wine
start
/unix
"$SETUP_EXE"
POL_Wine_WaitExit
"$TITLE"
fi
POL_SetupWindow_VMS
$GAME_VMS
POL_Wine_SetVideoDriver
cat
<< EOF >
"$POL_USER_ROOT/tmp/PoP_Fix.reg"
[HKEY_CURRENT_USER\\Software\\Wine\\DirectSound]
"MaxShadowSize"
=
"0"
EOF
POL_Wine
regedit
"$POL_USER_ROOT/tmp/PoP_Fix.reg"
[
"$POL_OS"
=
"Linux"
] && Set_SoundDriver
"alsa"
[
"$POL_OS"
=
"Linux"
] && Set_SoundEmulDriver
"Y"
[
"$POL_OS"
=
"Mac"
] && Set_Managed
"Off"
if
[ -e
"$WINEPREFIX/drive_c/windows/temp/"
];
then
rm
-rf
"$WINEPREFIX/drive_c/windows/temp/"
*
chmod
-R 777
"$POL_USER_ROOT/tmp/"
rm
-rf
"$POL_USER_ROOT/tmp/"
*
fi
if
[
"$INSTALL_METHOD"
!=
"STEAM"
];
then
POL_Shortcut
"Prince of Persia.exe"
"$TITLE"
"Prince of Persia : The Forgotten Sands.png"
""
fi
POL_Shortcut
"GameSettings.exe"
"$TITLE_SETTINGS"
"Prince of Persia : The Forgotten Sands (Configuration).png"
""
POL_SetupWindow_Close
exit
0