Changes for GOG.com - Thief 2
Revision by petch (13 April 2013 16:20:10)
@@ -1,6 +1,6 @@
#!/bin/bash
# Date : (2012-06-09 16-26)
-# Last revision : (2012-10-29 02-55)
+# Last revision : (2013-04-13 13-31)
# Wine version used : 1.3.37
# Distribution used to test : Debian Sid (Unstable)
# Author : Pierre Etchemaite pe-pol@concept-micro.com
@@ -26,19 +26,14 @@
POL_RequiredVersion "4.0.15" || POL_Debug_Fatal "$APPLICATION_TITLE 4.0.15 is required to install $TITLE"
POL_Debug_Init
-POL_SetupWindow_presentation "$TITLE" "Looking Glass Studios / Square Enix" "http://www.gog.com/en/gamecard/$GOGID" "Pierre Etchemaite" "$PREFIX"
+POL_SetupWindow_presentation "$TITLE" "Looking Glass Studios / Square Enix" "http://www.gog.com/gamecard/$GOGID" "Pierre Etchemaite" "$PREFIX"
POL_Call POL_GoG_setup "$GOGID" "580b15ebec40af636ec8d9ceedf69eb2"
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')"
+POL_Call POL_GoG_install
# GoG work!
@@ -83,12 +78,12 @@
_EOFFUNC_
-POL_Shortcut "thief2.exe" "$SHORTCUT_NAME" "$SHORTCUT_NAME.png" ""
+POL_Shortcut "thief2.exe" "$SHORTCUT_NAME" "$SHORTCUT_NAME.png" "" "Game;ActionGame;"
POL_Shortcut_InsertBeforeWine "$SHORTCUT_NAME" 'source thief2_funcs || exit 0'
POL_Shortcut_InsertBeforeWine "$SHORTCUT_NAME" 'sync_resolutions'
POL_Shortcut_Document "$SHORTCUT_NAME" "$WINEPREFIX/drive_c/$PROGRAMFILES/GOG.com/Thief 2/Manual.pdf"
-#POL_Shortcut "thief2_no_ddfix.exe" "$SHORTCUT_NAME (no DDFix)" "$SHORTCUT_NAME.png" ""
+#POL_Shortcut "thief2_no_ddfix.exe" "$SHORTCUT_NAME (no DDFix)" "$SHORTCUT_NAME.png" "" "Game;ActionGame;"
#POL_Shortcut_InsertBeforeWine "$SHORTCUT_NAME (no DDFix)" 'taskset -pc 0 $$'
POL_SetupWindow_Close
@@ -121,7 +116,7 @@
write_t2_settings
POL_SetupWindow_Close
-exit
+exit 0
_EOF_
-exit
+exit 0
Revision by petch (28 October 2012 14:28:03)
@@ -1,6 +1,6 @@
#!/bin/bash
# Date : (2012-06-09 16-26)
-# Last revision : (2012-06-10 04-00)
+# Last revision : (2012-10-29 02-55)
# Wine version used : 1.3.37
# Distribution used to test : Debian Sid (Unstable)
# Author : Pierre Etchemaite pe-pol@concept-micro.com
@@ -15,12 +15,13 @@
PREFIX="Thief2_gog"
WORKING_WINE_VERSION="1.3.37"
-TITLE="Thief 2 - The Metal Age (GoG release)"
+TITLE="GOG.com - Thief 2"
SHORTCUT_NAME="Thief 2: The Metal Age"
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_SetupWindow_SetID 1250
# For POL_LoadVar_ScreenResolution
POL_RequiredVersion "4.0.15" || POL_Debug_Fatal "$APPLICATION_TITLE 4.0.15 is required to install $TITLE"
POL_Debug_Init
Revision by petch (10 June 2012 04:05:03)
@@ -0,0 +1,126 @@
+#!/bin/bash
+# Date : (2012-06-09 16-26)
+# Last revision : (2012-06-10 04-00)
+# Wine version used : 1.3.37
+# 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="thief_2_the_metal_age"
+PREFIX="Thief2_gog"
+WORKING_WINE_VERSION="1.3.37"
+
+TITLE="Thief 2 - The Metal Age (GoG release)"
+SHORTCUT_NAME="Thief 2: The Metal Age"
+
+POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"
+
+POL_SetupWindow_Init
+# For POL_LoadVar_ScreenResolution
+POL_RequiredVersion "4.0.15" || POL_Debug_Fatal "$APPLICATION_TITLE 4.0.15 is required to install $TITLE"
+POL_Debug_Init
+
+POL_SetupWindow_presentation "$TITLE" "Looking Glass Studios / Square Enix" "http://www.gog.com/en/gamecard/$GOGID" "Pierre Etchemaite" "$PREFIX"
+
+POL_Call POL_GoG_setup "$GOGID" "580b15ebec40af636ec8d9ceedf69eb2"
+
+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 "8"
+
+cd "$POL_USER_ROOT/tmp"
+POL_Download "ftp://ftp.us.dell.com/audio/IV5PLAY.EXE" "24e0c7e08fb3e06b431803a896fc8b25"
+cabextract -F IR50_32.DLL -d "$WINEPREFIX/drive_c/windows/system32/" IV5PLAY.EXE
+POL_Wine regsvr32 IR50_32.DLL
+
+# Doesn't hurt ;)
+POL_Wine_reboot
+
+cat <<_EOFFUNC_ > "$WINEPREFIX/drive_c/$PROGRAMFILES/GOG.com/Thief 2/thief2_funcs"
+
+read_t2_settings () {
+ [ -z "\$WINEPREFIX" ] && POL_Debug_Fatal 'read_t2_settings: \$WINEPREFIX must be set'
+ perl -ne 'BEGIN { \$width=800; \$height=600; }
+ \$width=\$1, \$height=\$2 if /^game_screen_size (\d+) (\d+)/;
+ END { print "WIDTH=\$width\nHEIGHT=\$height\n" }' "\$WINEPREFIX/drive_c/$PROGRAMFILES/GOG.com/Thief 2/cam.cfg"
+}
+
+write_t2_settings () {
+ [ -z "\$WINEPREFIX" -o -z "\$WIDTH" -o -z "\$HEIGHT" ] && POL_Debug_Fatal 'write_t2_settings: \$WINEPREFIX, \$WIDTH and \$HEIGHT must be set'
+ perl -i.bak -pe 's/^game_screen_size \d+ \d+/game_screen_size '"\$WIDTH \$HEIGHT"'/' "\$WINEPREFIX/drive_c/$PROGRAMFILES/GOG.com/Thief 2/cam.cfg"
+ perl -i.bak -pe 's/^gWidth=\d+/gWidth='"\$WIDTH"'/;
+ s/^gHeight=\d+/gHeight='"\$HEIGHT"'/;' "\$WINEPREFIX/drive_c/$PROGRAMFILES/GOG.com/Thief 2/ddfix.ini"
+}
+
+sync_resolutions () {
+ eval \$(read_t2_settings)
+ write_t2_settings
+ POL_LoadVar_ScreenResolution
+ if [ "\$WIDTH" = "\$ScreenWidth" -a "\$HEIGHT" = "\$ScreenHeight" ]; then
+ Set_Desktop "Off"
+ else
+ Set_Desktop "On" "\$WIDTH" "\$HEIGHT"
+ fi
+}
+
+_EOFFUNC_
+
+POL_Shortcut "thief2.exe" "$SHORTCUT_NAME" "$SHORTCUT_NAME.png" ""
+POL_Shortcut_InsertBeforeWine "$SHORTCUT_NAME" 'source thief2_funcs || exit 0'
+POL_Shortcut_InsertBeforeWine "$SHORTCUT_NAME" 'sync_resolutions'
+POL_Shortcut_Document "$SHORTCUT_NAME" "$WINEPREFIX/drive_c/$PROGRAMFILES/GOG.com/Thief 2/Manual.pdf"
+
+#POL_Shortcut "thief2_no_ddfix.exe" "$SHORTCUT_NAME (no DDFix)" "$SHORTCUT_NAME.png" ""
+#POL_Shortcut_InsertBeforeWine "$SHORTCUT_NAME (no DDFix)" 'taskset -pc 0 $$'
+
+POL_SetupWindow_Close
+
+cat <<_EOF_ > "$POL_USER_ROOT/configurations/configurators/$SHORTCUT_NAME"
+#!/bin/bash
+[ -z "\$PLAYONLINUX" ] && exit 0
+source "\$PLAYONLINUX/lib/sources"
+export WINEPREFIX="\$POL_USER_ROOT/wineprefix/$PREFIX"
+export WINEDEBUG="-all"
+
+POL_LoadVar_PROGRAMFILES
+
+cd "\$WINEPREFIX/drive_c/\$PROGRAMFILES/GOG.com/Thief 2/" || exit 1
+
+TITLE="$TITLE"
+
+POL_SetupWindow_Init
+POL_Debug_Init
+
+source thief2_funcs || exit 1
+eval \$(read_t2_settings)
+POL_Debug_Message "Resolution read: \$WIDTH \$HEIGHT"
+
+POL_SetupWindow_menu_list "\$(eval_gettext 'Select game resolution:')" "\$TITLE" "800x600~1024x768~1280x1024" "~" "\${WIDTH}x\${HEIGHT}"
+WIDTH="\$(echo \$APP_ANSWER|cut -dx -f1)"
+HEIGHT="\$(echo \$APP_ANSWER|cut -dx -f2)"
+
+POL_Debug_Message "Resolution written: \$WIDTH \$HEIGHT"
+write_t2_settings
+
+POL_SetupWindow_Close
+exit
+_EOF_
+
+exit