If anybody need last version of the script...
---------------------------------------------------------------------------------
#!/bin/bash
# Date : (2011-6-11 19-41)
# Last revision : (2011-11-11 21-11)
# Wine version used : 1.3.18 - 1.3.32
# Distribution used to test : Kubuntu 11.10 x64
# Author : Ulrick(No)
# Licence : Retail
# Only For : http://www.playonmac.com
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
TITLE="Gothic 3"
PREFIX="gothic3"
WORKING_WINE_VERSION="1.3.18"
GAME_VMS="512"
DEVELOPER="Piranha Bytes"
SCRIPTCREATOR="Ulrick(No)"
COMPANYSITE="http://www.pluto13.de/"
RESOLUTION="What resolution is on your desktop?"
if [ "$POL_LANG" == "ru" ] ; then
CHOOSE="Выберите установочный файл $TITLE"
INSTALLATION="Пожалуйста подождите, идет установка..."
GAME_VMS="Сколько памяти у вашей видеокарты ?"
END="$TITLE установлена !"
else #English messages
CHOOSE="Select the installation file of $TITLE."
INSTALLATION="Please wait during the installation..."
GAME_VMS="How much video ram is ?"
END="$Title installation is a succes ! "
fi
# Starting the script
POL_SetupWindow_Init
# Starting debugging API
POL_Debug_Init
POL_SetupWindow_presentation "$TITLE" "$DEVELOPER" "$COMPANYSITE" "$SCRIPTCREATOR" "$PREFIX"
# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"
# Downloading wine if necessary and creating prefix
Set_Arch "x86"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
# Choose between DVD and Digital Download version
POL_SetupWindow_InstallMethod "DVD,LOCAL"
# Installing mandatory dependencies
POL_Call POL_Install_dxfullsetup
POL_Call POL_Install_devenum
POL_Call POL_Install_dinput8
POL_Call POL_Install_dsound
POL_Call POL_Install_dotnet20
POL_Call POL_Install_vcrun2005
POL_Call POL_Install_vcrun2008
POL_Call POL_Install_vcrun6
# Begin game installation
if [ "$INSTALL_METHOD" == "DVD" ]; then
# Asking for CDROM and checking if it's correct one
POL_SetupWindow_message "$(eval_gettext 'Please insert game media into your disk drive\\nif not already done.')"
POL_SetupWindow_cdrom
POL_Wine start /unix "$CDROM/setup.exe"
POL_Wine_WaitExit "$TITLE"
else
# Asking then installing DDV of the game
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
# Asking about memory size of graphic card
POL_SetupWindow_menu_list "$GAME_VMS" "$TITLE" "128-256-320-384-512-640-768-896-1024-1792-2048" "-" "256"
VMS="$APP_ANSWER"
# Fix for this game
POL_Wine_DirectSound "MaxShadowSize" "0"
POL_Wine_Direct3D "UseGLSL" "enabled"
Set_DXGrab On
Set_Managed Off
# Set Graphic Card information keys for wine
POL_Wine_SetVideoDriver
# Sound problem fix - pulseaudio related
[ "$POL_OS" = "Linux" ] && Set_SoundDriver "alsa"
[ "$POL_OS" = "Linux" ] && Set_SoundEmulDriver "Y"
## End Fix
## Begin Common PlayOnMac Section ##
[ "$POL_OS" = "Mac" ] && Set_Managed "Off"
## End Section ##
# Graphic fix
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Fullscreen\\=true/Fullscreen\\=false/ > ge3.ini
# Asking about graphic resolution
POL_SetupWindow_menu_list "$RESOLUTION" "$TITLE" "800/600-1152/864-1024/768-1280/720-1280/800-1280/900-1280/1024-1360/768-1440/900-1400/1050-1600/900-1600/1024-1680/1050-1920/1080" "-" "800/600"
RESOLUTION="$APP_ANSWER"
# Setting graphic resolution
# Setting resolution to 800/600
if [ "$RESOLUTION" == "800/600" ]; then
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Right\\=1024/Right\\=800/ > ge3.ini
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Bottom\\=768/Bottom\\=600/ > ge3.ini
# Setting virtual desktop
Set_Desktop On 800 600
fi
# Setting resolution to 1152/864
if [ "$RESOLUTION" == "1152/864" ]; then
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Right\\=1024/Right\\=1152/ > ge3.ini
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Bottom\\=768/Bottom\\=864/ > ge3.ini
# Setting virtual desktop
Set_Desktop On 1152 864
fi
# Setting resolution to 1024/768
if [ "$RESOLUTION" == "1024/768" ]; then
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Right\\=1024/Right\\=1024/ > ge3.ini
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Bottom\\=768/Bottom\\=768/ > ge3.ini
# Setting virtual desktop
Set_Desktop On 1024 768
fi
# Setting resolution to 1280/720
if [ "$RESOLUTION" == "1280/720" ]; then
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Right\\=1024/Right\\=1280/ > ge3.ini
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Bottom\\=768/Bottom\\=720/ > ge3.ini
# Setting virtual desktop
Set_Desktop On 1280 720
fi
# Setting resolution to 1280/800
if [ "$RESOLUTION" == "1280/800" ]; then
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Right\\=1024/Right\\=1280/ > ge3.ini
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Bottom\\=768/Bottom\\=800/ > ge3.ini
# Setting virtual desktop
Set_Desktop On 1280 800
fi
# Setting resolution to 1280/900
if [ "$RESOLUTION" == "1280/900" ]; then
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Right\\=1024/Right\\=1280/ > ge3.ini
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Bottom\\=768/Bottom\\=900/ > ge3.ini
# Setting virtual desktop
Set_Desktop On 1280 900
fi
# Setting resolution to 1280/1024
if [ "$RESOLUTION" == "1280/1024" ]; then
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Right\\=1024/Right\\=1280/ > ge3.ini
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Bottom\\=768/Bottom\\=1024/ > ge3.ini
# Setting virtual desktop
Set_Desktop On 1280 1024
fi
# Setting resolution to 1360/768
if [ "$RESOLUTION" == "1360/768" ]; then
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Right\\=1024/Right\\=1360/ > ge3.ini
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Bottom\\=768/Bottom\\=768/ > ge3.ini
# Setting virtual desktop
Set_Desktop On 1360 768
fi
# Setting resolution to 1440/900
if [ "$RESOLUTION" == "1440/900" ]; then
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Right\\=1024/Right\\=1400/ > ge3.ini
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Bottom\\=768/Bottom\\=900/ > ge3.ini
# Setting virtual desktop
Set_Desktop On 1440 900
fi
# Setting resolution to 1400/1050
if [ "$RESOLUTION" == "1400/1050" ]; then
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Right\\=1024/Right\\=1400/ > ge3.ini
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Bottom\\=768/Bottom\\=1050/ > ge3.ini
# Setting virtual desktop
Set_Desktop On 1400 1050
fi
# Setting resolution to 1600/900
if [ "$RESOLUTION" == "1600/900" ]; then
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Right\\=1024/Right\\=1600/ > ge3.ini
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Bottom\\=768/Bottom\\=900/ > ge3.ini
# Setting virtual desktop
Set_Desktop On 1600 900
fi
# Setting resolution to 1600/1024
if [ "$RESOLUTION" == "1600/1024" ]; then
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Right\\=1024/Right\\=1600/ > ge3.ini
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Bottom\\=768/Bottom\\=1024/ > ge3.ini
# Setting virtual desktop
Set_Desktop On 1600 1024
fi
# Setting resolution to 1680/1050
if [ "$RESOLUTION" == "1680/1050" ]; then
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Right\\=1024/Right\\=1680/ > ge3.ini
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Bottom\\=768/Bottom\\=1050/ > ge3.ini
# Setting virtual desktop
Set_Desktop On 1680 1050
fi
# Setting resolution to 1920/1080
if [ "$RESOLUTION" == "1920/1080" ]; then
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Right\\=1024/Right\\=1920/ > ge3.ini
cd "$POL_USER_ROOT/wineprefix/$PREFIX/drive_c/$PROGRAMFILES/Gothic 3/Ini/" || POL_Debug_Error "Unable to find Gothic 3 folder"
mv ge3.ini ge3.ini.back
cat ge3.ini.back | sed s/Bottom\\=768/Bottom\\=1080/ > ge3.ini
# Setting virtual desktop
Set_Desktop On 1920 1080
fi
# Making shortcut
POL_Shortcut "Gothic3.exe" "$TITLE" "" ""
POL_SetupWindow_Close
exit 0
ulrickno94