Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 12bec936a3
Fetching contributors…

Cannot retrieve contributors at this time

100 lines (72 sloc) 3.682 kB
#!/bin/bash
# Date : (2012-05-31 20-09)
# Last revision : (2012-06-02 17-34)
# Wine version used : 1.5.5
# Distribution used to test : Debian Sid (Unstable)
# Author : Pierre Etchemaite pe-pol@concept-micro.com
# Script licence : GPL v.2
# Program licence : Retail
# Depend :
[ -z "$PLAYONLINUX" ] && exit 0
source "$PLAYONLINUX/lib/sources"
GOGID="gothic_2_gold_edition"
PREFIX="Gothic2_gog"
WORKING_WINE_VERSION="1.5.5"
TITLE="Gothic 2 Gold (GoG release)"
SHORTCUT_NAME="Gothic 2 Gold"
#POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"
POL_SetupWindow_Init
POL_Debug_Init
POL_SetupWindow_presentation "$TITLE" "Piranha Bytes / Nordic Games" "http://www.gog.com/en/gamecard/$GOGID" "Pierre Etchemaite" "$PREFIX"
POL_Call POL_GoG_setup "$GOGID" "62ca675dafe649497c03fe52de41433f"
POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WORKING_WINE_VERSION"
# Prevent GoG installer from installing Acrobat Reader or Foxit in each prefix
POL_Call POL_Function_SetNativeExtension "pdf"
POL_Wine_WaitBefore "$TITLE"
POL_Wine "$POL_GoG_location" || POL_Debug_Fatal "$(eval_gettext 'Error while installing archive')"
# GoG work!
Set_OS winxp
POL_SetupWindow_VMS "32"
POL_Call POL_Install_directmusic
# vdfs32e.exe often crashes, couldn't find a solution
POL_Call POL_Install_DisableCrashDialog
# Doesn't hurt ;)
POL_Wine_reboot
# extendedMenu allows to set resolution ingame
# tip from http://www.gog.com/en/forum/gothic_series/notes_on_widescreen_resolution
cat <<_EOFFUNC_ > "$WINEPREFIX/drive_c/$PROGRAMFILES/GOG.com/Gothic 2 Gold/gothic2_funcs"
# echo statements to set \$zVidResFullscreenX, \$zVidResFullscreenY and \$zVidResFullscreenBPP
read_g2_settings () {
[ -z "\$WINEPREFIX" ] && POL_Debug_Fatal 'read_g2_settings: \$WINEPREFIX must be set'
perl -ne 'print "\$1\n" if /^((zVidResFullscreenX|zVidResFullscreenY|zVidResFullscreenBPP)=\d+)/' "\$WINEPREFIX/drive_c/$PROGRAMFILES/GOG.com/Gothic 2 Gold/system/Gothic.ini"
}
# update Gothic.ini with value of \$zVidResFullscreenX, \$zVidResFullscreenY and \$zVidResFullscreenBPP
write_g2_settings () {
[ -z "\$WINEPREFIX" ] && POL_Debug_Fatal 'write_g2_settings: \$WINEPREFIX must be set'
perl -i.bak -pe 's/^zVidResFullscreenX=\d+/zVidResFullscreenX='"\$zVidResFullscreenX"'/;
s/^zVidResFullscreenY=\d+/zVidResFullscreenY='"\$zVidResFullscreenY"'/;
s/^zVidResFullscreenBPP=\d+/zVidResFullscreenBPP='"\$zVidResFullscreenBPP"'/;
s/^extendedMenu=\d+/extendedMenu=1/;' "\$WINEPREFIX/drive_c/$PROGRAMFILES/GOG.com/Gothic 2 Gold/system/Gothic.ini"
}
# until POL_LoadVar_ScreenResolution does it?
LoadVar_ScreenDepth () {
export ScreenBpp=\$(xdpyinfo |perl -ne 'print \$1 if /^bitmap unit, bit order, padding:\s*(\d+)/')
POL_Debug_Message "Screen depth: \$ScreenBpp"
}
sync_resolutions () {
LoadVar_ScreenDepth
eval \$(read_g2_settings)
[ "\$zVidResFullscreenBPP" != "\$ScreenBpp" ] && zVidResFullscreenBPP="\$ScreenBpp" write_g2_settings
Set_Desktop "On" "\$zVidResFullscreenX" "\$zVidResFullscreenY"
}
_EOFFUNC_
POL_Shortcut "Gothic.exe" "$SHORTCUT_NAME" "$SHORTCUT_NAME.png" ""
# Using $WINEPREFIX here causes trouble, bug #953
POL_Shortcut_InsertBeforeWine "$SHORTCUT_NAME" 'source "../gothic2_funcs" || exit 0'
POL_Shortcut_InsertBeforeWine "$SHORTCUT_NAME" 'sync_resolutions'
POL_Shortcut_Document "$SHORTCUT_NAME" "$WINEPREFIX/drive_c/$PROGRAMFILES/GOG.com/Gothic 2 Gold/manual.pdf"
# C:\Program Files\GOG.com\Gothic 2 Gold\Readme.txt
# C:\Program Files\GOG.com\Gothic 2 Gold\manual_addon.pdf
POL_SetupWindow_Close
exit
Jump to Line
Something went wrong with that request. Please try again.