The forum

[script] Call of Duty 4: Modern Warfare

Author Replies
NSLW Monday 11 May 2009 at 17:42
NSLW

Hello,
I wrote script which installs Call of Duty 4: Modern Warfare. It also can patch the game after it's been installed

Wine version : 1.1.21
Distribution : Fedora
Distribution Version : 10 (32 bit)
Graphics card : Nvidia, GeForce 9xxx
Drivers of the graphics card : 185.18.08
Comments
-use latest 1.7 game patch
-disable "depth of field" and "soften smoke edges" in game as they don't work
-don't install DirectX 9.0c if prompted
-game doesn't work with original iw3sp.exe

The script should be tested more so don't expect this to work in every case.

Icon for the game:



#!/bin/bash
if [ "$PLAYONLINUX" = "" ]
then
exit 0
fi
source "$PLAYONLINUX/lib/sources"

TYTUL="Call of Duty 4: Modern Warfare"
PREFIX="COD4"

#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"
}

POL_SetupWindow_Init
POL_SetupWindow_presentation "$TYTUL" "infinityward" "N/A" "NSLW" "$PREFIX" 

select_prefixe "$REPERTOIRE/wineprefix/$PREFIX"

#asking about patching
POL_SetupWindow_menu "What do you want to do?" "Actions" "install-game patch-game" " "
if [ "$APP_ANSWER" == "patch-game" ]; then
	if [ -e "$REPERTOIRE/wineprefix/$PREFIX" ]; then
	patch_cod4
	fi
POL_SetupWindow_Close
fi

POL_SetupWindow_prefixcreate

POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "setup.exe"

#adding CD-ROM as drive d: to winecfg
cd $WINEPREFIX/dosdevices
ln -s $CDROM d:

echo "[HKEY_LOCAL_MACHINE\\\\Software\\\\Wine\\\\Drives]" > $REPERTOIRE/tmp/cdrom.reg
echo "\\"d:\\"=\\"cdrom\\"" >> $REPERTOIRE/tmp/cdrom.reg
regedit $REPERTOIRE/tmp/cdrom.reg

POL_SetupWindow_message "Wait 5 seconds then click next" "$TYTUL"

#starting installation
POL_SetupWindow_wait_next_signal "Installation in progress..." "$TYTUL"
cd $CDROM
wine "setup.exe"
POL_SetupWindow_detect_exit


#setting OffscreenRenderingMode to fbo and Multisampling to enabled
echo "[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]" > $WINEPREFIX/drive_c/windows/temp/msfbo.reg
echo "\\"OffscreenRenderingMode\\"=\\"fbo\\"" >> $WINEPREFIX/drive_c/windows/temp/msfbo.reg
echo "\\"Multisampling\\"=\\"enabled\\"" >> $WINEPREFIX/drive_c/windows/temp/msfbo.reg
regedit $WINEPREFIX/drive_c/windows/temp/msfbo.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-1024-2048" "-" "256"
VMS="$APP_ANSWER"
 
echo "[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]" > $WINEPREFIX/drive_c/windows/temp/vms.reg
echo "\\"VideoMemorySize\\"=\\"$VMS\\"" >> $WINEPREFIX/drive_c/windows/temp/vms.reg
regedit $WINEPREFIX/drive_c/windows/temp/vms.reg


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
cd $REPERTOIRE
rm -rf $WINEPREFIX/drive_c/windows/temp/*

#making shortcut
POL_SetupWindow_make_shortcut "$PREFIX" "Program Files/Activision/Call of Duty 4 - Modern Warfare" "iw3sp.exe" "" "$TYTUL Singleplayer" "" ""
POL_SetupWindow_make_shortcut "$PREFIX" "Program Files/Activision/Call of Duty 4 - Modern Warfare" "iw3mp.exe" "" "$TYTUL Multiplayer" "" ""

POL_SetupWindow_message "$TYTUL has been installed successfully" "$TYTUL"

#asking about patching
POL_SetupWindow_question "Do you want to patch your game?" "$TYTUL"
if [ "$APP_ANSWER" == "TRUE" ] ;then
patch_cod4
fi

POL_SetupWindow_Close
exit

Edited by NSLW

GNU_Raziel Wednesday 20 May 2009 at 14:54
GNU_Raziel

Script deleted as you requested.

Edited by GNU_Raziel

This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmca-notice@playonlinux.com