#!/bin/bash
[
"$PLAYONLINUX"
=
""
] &&
exit
0
source
"$PLAYONLINUX/lib/sources"
TYTUL=
"Unreal Tournament 3"
PREFIX=
"UT3"
WORKINGWINEVERSION=
"1.1.43"
patch_ut3()
{
POL_SetupWindow_browse
"Select patch file downloaded from www.unrealtournament3.com"
"$TYTUL"
""
wine
"$APP_ANSWER"
POL_SetupWindow_message
"Patch for $TYTUL has been installed successfully"
"$TYTUL"
}
download_dinput()
{
cd
"$REPERTOIRE/ressources/"
if
[ ! -e $REPERTOIRE
/ressources/
$WORKINGWINEVERSION-mod.zip ];
then
fi
cd
"$WINEPREFIX/drive_c/windows/temp/"
unzip
"$REPERTOIRE/ressources/$WORKINGWINEVERSION-mod.zip"
./$WORKINGWINEVERSION-mod -y
cp
dinput/* ./
}
Create_Patched_Wine_Version()
{
POL_SetupWindow_install_wine
"$1"
cd
"$REPERTOIRE/WineVersions"
POL_SetupWindow_wait_next_signal
"Removing old patched Wine"
"$TYTUL"
rm
-fr
"$1-$2"
POL_SetupWindow_detect_exit
POL_SetupWindow_wait_next_signal
"Copying Wine $1"
"$TYTUL"
cp
-r
"$1"
"$1-$2"
POL_SetupWindow_detect_exit
POL_SetupWindow_wait_next_signal
"Patching Wine $1 with $2"
"$TYTUL"
rm
-fr
"$REPERTOIRE/WineVersions/$1-$2/usr/lib/wine/dinput.dll.so"
cp
"$WINEPREFIX/drive_c/windows/temp/dinput.dll.so"
"$REPERTOIRE/WineVersions/$1-$2/usr/lib/wine/dinput.dll.so"
POL_SetupWindow_detect_exit
}
wget http:
//upload
.wikimedia.org
/wikipedia/en/d/d9/Unreal_Tournament_3
.jpg --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"
"Epic Games"
"N/A"
"NSLW"
"$PREFIX"
select_prefix
"$REPERTOIRE/wineprefix/$PREFIX"
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_ut3
fi
POL_SetupWindow_Close
exit
fi
POL_SetupWindow_prefixcreate
download_dinput
Create_Patched_Wine_Version
"$WORKINGWINEVERSION"
"dinput"
CHOSENWINEVERSION=
"$WORKINGWINEVERSION-dinput"
Use_WineVersion
"$CHOSENWINEVERSION"
PROGRAMFILES=
"Program Files"
POL_LoadVar_PROGRAMFILES
mkdir
"$HOME/.winetrickscache"
cd
"$HOME/.winetrickscache"
if
[ ! -e
"wine_gecko-1.0.0-x86.cab"
]
then
fi
cd
"$REPERTOIRE/ressources/"
if
[
"`sha1sum < winetricks | sed 's/ .*//'`"
!=
"1bc6af44c8584f01d8e3db0abce6ae869b55e1e4"
];
then
wget http:
//winezeug
.googlecode.com
/svn/trunk/winetricks
--output-document=winetricks
fi
POL_SetupWindow_wait_next_signal
"Installing Gecko HTML"
"$TYTUL"
bash
winetricks -q gecko
POL_SetupWindow_detect_exit
POL_SetupWindow_message
"Please insert $TYTUL media into your disk drive."
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom
"SetupUT3.exe"
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
wine start
/unix
"$CDROM/SetupUT3.exe"
POL_SetupWindow_message
"Click \\"
Next\\
" when installation will finish."
"$TYTUL"
cd
"$WINEPREFIX/drive_c/windows/temp/"
echo
"[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\DirectInput]"
> mwo.reg
echo
"\\"
MouseWarpOverride\\
"=\\"
force\\
""
>> mwo.reg
regedit mwo.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
echo
"\\"
Multisampling\\
"=\\"
enabled\\
""
>> vms.reg
regedit vms.reg
cd
"$WINEPREFIX/drive_c/windows/temp/"
convert
"$CDROM/Unreal.ico"
-geometry 32X32
"Unreal.png"
cp
"Unreal.png"
"$REPERTOIRE/icones/32/$TYTUL"
cd
"$WINEPREFIX/drive_c/windows/temp/"
rm
-rf *
POL_SetupWindow_make_shortcut
"$PREFIX"
"$PROGRAMFILES/Unreal Tournament 3/Binaries"
"UT3.exe"
""
"$TYTUL"
""
""
Set_WineVersion_Assign
"$CHOSENWINEVERSION"
"$TYTUL"
POL_SetupWindow_message
"$TYTUL has been installed successfully"
"$TYTUL"
POL_SetupWindow_question
"Do you want to patch your game?"
"$TYTUL"
if
[
"$APP_ANSWER"
==
"TRUE"
] ;
then
patch_ut3
fi
POL_SetupWindow_Close
exit