@@ -1,125 +1,78 @@
#!/bin/bash
# Date : (2009-05-23 12-14)
-# Last revision : (2009-11-16 09-00)
-# Wine version used : 1.1.21
-# Distribution used to test : Fedora 10
+# Last revision : (2015-05-27 07-07)
+# Wine version used : 1.6.2
# Author : NSLW
+# updated: petch
# Licence : Retail
-
+
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
-
-TYTUL="Call of Duty 4: Modern Warfare"
+
+TITLE="Call of Duty 4: Modern Warfare"
PREFIX="COD4"
-
-Get_Latest_Wine_Version()
-{
-cd "$REPERTOIRE/tmp"
-xyz=`cat "$REPERTOIRE/tmp/LIST" | sed -e 's/\.//g' | cut -d';' -f2 | sort -n | tail -n1`
-echo "$(echo $xyz | cut -c1-1).$(echo $xyz | cut -c2-2).$(echo $xyz | cut -c3-4)"
-}
-
+
#procedure for patching cod4
patch_cod4()
{
-POL_SetupWindow_browse "Select patch file downloaded from www.infinityward.com" "$TYTUL" ""
-wine "$APP_ANSWER"
-POL_SetupWindow_message "Patch for $TYTUL has been installed successfully" "$TYTUL"
+ cd "$HOME"
+ POL_SetupWindow_browse "$(eval_gettext 'Select patch file downloaded from www.infinityward.com')" "$TITLE" ""
+ POL_Wine_WaitBefore "$TITLE"
+ POL_Wine "$APP_ANSWER"
+ POL_SetupWindow_message "$(eval_gettext 'Patch for $TITLE has been installed successfully')" "$TITLE"
}
-
+
POL_SetupWindow_Init
-POL_SetupWindow_presentation "$TYTUL" "infinityward" "www.infinityward.com" "NSLW" "$PREFIX"
-
-select_prefix "$REPERTOIRE/wineprefix/$PREFIX"
-
-#asking about patching or updating Wine version
-if [ -e "$REPERTOIRE/configurations/installed/$TYTUL" ]; then
-POL_SetupWindow_menu "What do you want to do?" "Actions" "Patch game" "~"
-
-if [ "$APP_ANSWER" == "Patch game" ]; then
- patch_cod4
-fi
-
-POL_SetupWindow_Close
-exit
+POL_Debug_Init
+
+POL_SetupWindow_presentation "$TITLE" "infinityward" "www.infinityward.com" "NSLW" "$PREFIX"
+
+if [ -e "$POL_USER_ROOT/configurations/installed/$TITLE" ]; then
+ POL_SetupWindow_menu "$(eval_gettext 'What do you want to do?')" "$(eval_gettext 'Actions')" "$(eval_gettext 'Patch game')" "~"
+
+ if [ "$APP_ANSWER" == "$(eval_gettext 'Patch game')" ]; then
+ patch_cod4
+ fi
+
+ POL_SetupWindow_Close
+ exit 0
fi
-
-POL_SetupWindow_message "Please insert $TYTUL media into your disk drive."
+
+POL_SetupWindow_message "$(eval_gettext 'Please insert $TITLE media into your disk drive.')"
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "setup.exe"
-
-LATESTVERSION=$(Get_Latest_Wine_Version)
+
+LATESTVERSION="1.6.2"
CHOSENWINEVERSION="$LATESTVERSION"
-POL_SetupWindow_install_wine "$CHOSENWINEVERSION"
-Use_WineVersion "$CHOSENWINEVERSION"
-
-POL_SetupWindow_prefixcreate
-#fetching PROGRAMFILES environmental variable
-#PROGRAMFILES=`wine cmd /c echo "%ProgramFiles%" |tr -d '\015' | tr -d '\010'`
-#PROGRAMFILES=${PROGRAMFILES:3}
-
-PROGRAMFILES="Program Files"
-POL_LoadVar_PROGRAMFILES
-
-#adding CD-ROM as drive e: to winecfg
-cd "$WINEPREFIX/dosdevices"
-ln -s "$CDROM" e:
-
-cd "$WINEPREFIX/drive_c/windows/temp/"
-echo "[HKEY_LOCAL_MACHINE\\Software\\Wine\\Drives]" > cdrom.reg
-echo "\"e:\"=\"cdrom\"" >> cdrom.reg
-regedit cdrom.reg
-
-sleep 5
-
+
+POL_Wine_SelectPrefix "$PREFIX"
+POL_Wine_PrefixCreate "$CHOSENWINEVERSION"
+
#starting installation
-POL_SetupWindow_wait_next_signal "Installation in progress..." "$TYTUL"
+POL_Wine_WaitBefore "$TITLE"
cd "$CDROM"
-wine "setup.exe"
-POL_SetupWindow_detect_exit
-
-cd "$WINEPREFIX/drive_c/windows/temp/"
-#setting Multisampling to enabled
-echo "[HKEY_CURRENT_USER\\Software\\Wine\\Direct3D]" > multisampling.reg
-echo "\"Multisampling\"=\"enabled\"" >> multisampling.reg
-regedit multisampling.reg
-
-#asking about memory size
-POL_SetupWindow_menu_list "How much memory do your graphic card have got?" "$TYTUL" "32-64-128-256-384-512-768-890-1024-2048" "-" "256"
-VMS="$APP_ANSWER"
-
-echo "[HKEY_CURRENT_USER\\Software\\Wine\\Direct3D]" > vms.reg
-echo "\"VideoMemorySize\"=\"$VMS\"" >> vms.reg
-regedit vms.reg
-
+POL_Wine "setup.exe"
+POL_Wine_WaitExit "$TITLE"
+
+POL_Wine_Direct3D "Multisampling" "enabled"
+POL_SetupWindow_VMS
+
cd "$WINEPREFIX/drive_c/windows/temp/"
convert "$CDROM/Setup/rsrc/cod4.ico" -geometry 32X32 "cod4.png"
-cp "cod4-1.png" "$REPERTOIRE/icones/32/$TYTUL Singleplayer"
-cp "cod4-1.png" "$REPERTOIRE/icones/32/$TYTUL Multiplayer"
-
-#cleaning temp
-if [ -e "$WINEPREFIX/drive_c/windows/temp/" ]; then
- rm -rf "$WINEPREFIX/drive_c/windows/temp/*"
- chmod -R 777 "$REPERTOIRE/tmp/"
- rm -rf "$REPERTOIRE/tmp/*"
-fi
-
+cp "cod4-1.png" "$POL_USER_ROOT/icones/32/$TITLE Singleplayer"
+cp "cod4-1.png" "$POL_USER_ROOT/icones/32/$TITLE Multiplayer"
+
#making shortcut
-POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Activision/Call of Duty 4 - Modern Warfare" "iw3sp.exe" "" "$TYTUL Singleplayer" "" ""
-POL_SetupWindow_make_shortcut "$PREFIX" "$PROGRAMFILES/Activision/Call of Duty 4 - Modern Warfare" "iw3mp.exe" "" "$TYTUL Multiplayer" "" ""
-Set_WineVersion_Assign "$CHOSENWINEVERSION" "$TYTUL Singleplayer"
-Set_WineVersion_Assign "$CHOSENWINEVERSION" "$TYTUL Multiplayer"
-
-POL_SetupWindow_message "$TYTUL has been installed successfully" "$TYTUL"
-
+POL_Shortcut "iw3sp.exe" "$TITLE Singleplayer"
+POL_Shortcut "iw3mp.exe" "$TITLE Multiplayer"
+
#asking about patching
-POL_SetupWindow_question "Do you want to patch your game?" "$TYTUL"
-if [ "$APP_ANSWER" == "TRUE" ] ;then
-patch_cod4
+POL_SetupWindow_question "$(eval_gettext 'Do you want to patch your game?')" "$TITLE"
+if [ "$APP_ANSWER" == "TRUE" ]; then
+ patch_cod4
fi
-
-POL_SetupWindow_message_image "Please note that this game has a copy protection system\nand sadly, it prevents Wine from running the game.\n\nPlayOnLinux will not provide any help concerning any illegal\nstuff." "Note about copy protection" "$PLAYONLINUX/themes/tango/warning.png"
-
+
+POL_SetupWindow_message "$(eval_gettext 'Please note that this game has a copy protection system\nand sadly, it prevents Wine from running the game.\n\nPlayOnLinux will not provide any help concerning any illegal\nstuff.')" "Note about copy protection"
+
POL_SetupWindow_Close
-exit
\ No newline at end of file
+exit 0
\ No newline at end of file