#!/bin/bash
[
"$PLAYONLINUX"
=
""
] &&
exit
source
"$PLAYONLINUX/lib/sources"
TITLE=
"Baldur's Gate II"
PREFIX=
"BaldursGate2"
EDITOR=
"BioWare"
AUTHOR=
"GNU_Raziel"
WORKING_WINE_VERSION=
"1.4"
GAME_VMS=
"128"
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
"CD,DVD,LOCAL"
if
[
"$INSTALL_METHOD"
==
"CD"
];
then
POL_SetupWindow_message
"$(eval_gettext 'Please insert the game media into your disk drive')"
"$TITLE"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom
"Setup.exe"
cd
"$WINEPREFIX"
/dosdevices
ln
-sf
"$CDROM"
p:
POL_Wine
start
/unix
"$CDROM/Setup.exe"
POL_SetupWindow_message
"$(eval_gettext 'When the game setup will ask for next Disk\nclick on \"Forward\"')"
"$TITLE"
POL_Wine
eject
POL_SetupWindow_message
"$(eval_gettext 'Please insert the next game media into your disk drive')"
"$TITLE"
POL_SetupWindow_cdrom
cd
"$WINEPREFIX"
/dosdevices
ln
-sf
"$CDROM"
p:
POL_SetupWindow_message
"$(eval_gettext 'When the game setup will ask for next Disk\nclick on \"Forward\"')"
"$TITLE"
POL_Wine
eject
POL_SetupWindow_message
"$(eval_gettext 'Please insert the next game media into your disk drive')"
"$TITLE"
POL_SetupWindow_cdrom
cd
"$WINEPREFIX"
/dosdevices
ln
-sf
"$CDROM"
p:
POL_SetupWindow_message
"$(eval_gettext 'Please insert the next game media into your disk drive')"
"$TITLE"
POL_SetupWindow_cdrom
cd
"$WINEPREFIX"
/dosdevices
ln
-sf
"$CDROM"
p:
POL_Wine_WaitExit
"$TITLE"
elif
[
"$INSTALL_METHOD"
==
"DVD"
];
then
POL_SetupWindow_message
"$(eval_gettext 'Please insert game media into your disk drive\nif not already done.')"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom
"baldur.exe"
POL_Wine
start
/unix
"$CDROM/Setup.exe"
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_OS"
=
"Linux"
] && Set_SoundDriver
"alsa"
[
"$POL_OS"
=
"Linux"
] && Set_SoundEmulDriver
"Y"
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
POL_Shortcut
"baldur.exe"
"$TITLE"
"$TITLE.png"
""
POL_SetupWindow_Close
exit
0