#!/bin/bash
[
"$PLAYONLINUX"
=
""
] &&
exit
0
source
"$PLAYONLINUX/lib/sources"
TYTUL=
"Call of Duty: Modern Warfare 2"
PREFIX=
"CODMW2"
STEAM=0
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)"
}
wget http:
//upload
.wikimedia.org
/wikipedia/en/d/db/Modern_Warfare_2_cover
.PNG --output-document=
"$REPERTOIRE/tmp/leftnotscaled.jpeg"
convert
"$REPERTOIRE/tmp/leftnotscaled.jpeg"
-scale 150x356\\!
"$REPERTOIRE/tmp/left.jpeg"
POL_SetupWindow_Init
""
"$REPERTOIRE/tmp/left.jpeg"
POL_SetupWindow_presentation
"$TYTUL"
"infinityward"
"www.infinityward.com"
"NSLW"
"$PREFIX"
select_prefix
"$REPERTOIRE/wineprefix/$PREFIX"
POL_SetupWindow_menu
"What do you want to do?"
"Actions"
"Install from DVD~Install Steam version from DVD"
"~"
if
[
"$APP_ANSWER"
==
"Adapt Steam version"
];
then
if
[ ! -e
"$REPERTOIRE/configurations/installed/Steam"
];
then
POL_SetupWindow_message
"Please install Steam before $TYTUL"
POL_SetupWindow_Close
exit
fi
if
[ ! -d
"$REPERTOIRE/wineprefix/Steam/drive_c/$PROGRAMFILES/Steam/steamapps/common/call of duty modern warfare 2"
];
then
POL_SetupWindow_message
"Please install $TYTUL in Steam first"
POL_SetupWindow_Close
exit
else
STEAM=
"1"
fi
elif
[
"$APP_ANSWER"
==
"Install Steam version from DVD"
];
then
if
[ ! -e
"$REPERTOIRE/configurations/installed/Steam"
];
then
POL_SetupWindow_message
"Please install Steam before $TYTUL"
POL_SetupWindow_Close
exit
fi
select_prefix
"$REPERTOIRE/wineprefix/Steam"
STEAM=
"2"
fi
LATESTVERSION=$(Get_Latest_Wine_Version)
CHOSENWINEVERSION=
"$LATESTVERSION"
POL_SetupWindow_install_wine
"$CHOSENWINEVERSION"
Use_WineVersion
"$CHOSENWINEVERSION"
if
[
"$STEAM"
==
"0"
] || [
"$STEAM"
==
"2"
] ;
then
POL_SetupWindow_message
"Please insert $TYTUL media into your disk drive."
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom
"Setup.exe"
mkdir
"$HOME/.winetrickscache"
cd
"$HOME/.winetrickscache"
if
[ ! -e
"vc6redistsetup_enu.exe"
]
then
fi
if
[
"$STEAM"
==
"0"
] ;
then
POL_SetupWindow_prefixcreate
fi
PROGRAMFILES=`wine cmd
/c
echo
"%ProgramFiles%"
`
PROGRAMFILES=${PROGRAMFILES:3}
CDROM2=${CDROM
//
"1"
/
"2"
}
cd
"$WINEPREFIX/dosdevices"
ln
-s
"$CDROM"
d:
ln
-s
"$CDROM2"
e:
cd
"$WINEPREFIX/drive_c/windows/temp/"
echo
"[HKEY_LOCAL_MACHINE\\\\Software\\\\Wine\\\\Drives]"
> cdrom.reg
echo
"\\"
d:\\
"=\\"
cdrom\\
""
>> cdrom.reg
echo
"\\"
e:\\
"=\\"
cdrom\\
""
>> cdrom.reg
regedit cdrom.reg
sleep
5
cd
"$REPERTOIRE/ressources/"
if
[
"`sha1sum < winetricks | sed 's/ .*//'`"
!=
"0e10e20bf6920e2ae32372e10b5872f7c21a8fd4"
];
then
wget http:
//winezeug
.googlecode.com
/svn/trunk/winetricks
--output-document=winetricks
fi
POL_SetupWindow_wait_next_signal
"Installing Visual C++ 6 runtime libraries..."
"$TYTUL"
bash
winetricks -q mfc42
POL_SetupWindow_detect_exit
POL_SetupWindow_wait_next_signal
"Installation in progress..."
"$TYTUL"
cd
"$CDROM"
wine
"Setup.exe"
POL_SetupWindow_detect_exit
cd
"$WINEPREFIX/drive_c/windows/temp/"
convert
"$CDROM/mw2.ico"
-geometry 32X32
"codmw4.png"
cp
"codmw4-1.png"
"$REPERTOIRE/icones/32/$TYTUL Singleplayer"
cp
"codmw4-1.png"
"$REPERTOIRE/icones/32/$TYTUL Multiplayer"
fi
cd
"$WINEPREFIX/drive_c/windows/temp/"
echo
"[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\Direct3D]"
> msa.reg
echo
"\\"
Multisampling\\
"=\\"
enabled\\
""
>> msa.reg
regedit msa.reg
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
cd
"$WINEPREFIX/drive_c/windows/temp"
rm
-rf *
if
[
"$STEAM"
==
"0"
] ;
then
POL_SetupWindow_make_shortcut
"$PREFIX"
"$PROGRAMFILES/Activision/Modern Warfare 2"
"iw4sp.exe"
""
"$TYTUL Singleplayer"
""
""
POL_SetupWindow_make_shortcut
"$PREFIX"
"$PROGRAMFILES/Activision/Modern Warfare 2"
"iw4mp.exe"
""
"$TYTUL Multiplayer"
""
""
else
POL_SetupWindow_make_shortcut
"$PREFIX"
"$PROGRAMFILES/Steam/steamapps/common/call of duty modern warfare 2"
"iw4sp.exe"
""
"$TYTUL Singleplayer"
""
""
POL_SetupWindow_make_shortcut
"$PREFIX"
"$PROGRAMFILES/Steam/steamapps/common/call of duty modern warfare 2"
"iw4mp.exe"
""
"$TYTUL Multiplayer"
""
""
fi
Set_WineVersion_Assign
"$CHOSENWINEVERSION"
"$TYTUL Singleplayer"
Set_WineVersion_Assign
"$CHOSENWINEVERSION"
"$TYTUL Multiplayer"
POL_SetupWindow_message
"$TYTUL has been installed successfully"
"$TYTUL"
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_Close
exit