Forums

[script] Unreal Tournament 3

Auteur Réponses
NSLW Lundi 18 Mai 2009 à 20:49
NSLW

Hello,
I wrote script which installs Unreal Tournament 3. 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
-do not patch the game to the latest version
-very poor performance

Icon for the game:



#!/bin/bash
# Date : (2010-03-04 18-00)
# Last revision : (2010-03-05 16-00)
# Wine version used : -
# Distribution used to test : -
# Author : NSLW
# Licence : Retail
# Depend : ImageMagick

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

TYTUL="Unreal Tournament 3"
PREFIX="UT3"
WORKINGWINEVERSION="1.1.43"

#procedure for patching UT3
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
POL_SetupWindow_download "Downloading dinput patch" "$TYTUL" "http://s2.sigmirror.com/files/63363_sssrl/$WORKINGWINEVERSION-mod.zip"
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
}

#starting the script
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"

#asking about patching
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

#creating application's own prefix
POL_SetupWindow_prefixcreate

download_dinput
Create_Patched_Wine_Version "$WORKINGWINEVERSION" "dinput"
CHOSENWINEVERSION="$WORKINGWINEVERSION-dinput"
Use_WineVersion "$CHOSENWINEVERSION"

#fetching PROGRAMFILES environmental variable
PROGRAMFILES="Program Files" 
POL_LoadVar_PROGRAMFILES

mkdir "$HOME/.winetrickscache"
cd "$HOME/.winetrickscache"
# checking if gecko is in wine tricks cache if not then download
if [ ! -e "wine_gecko-1.0.0-x86.cab" ]
then
POL_SetupWindow_download "PlayOnLinux is downloading Gecko HTML Engine" "Gecko HTML Engine" "http://downloads.sourceforge.net/wine/wine_gecko-1.0.0-x86.cab"
fi

cd "$REPERTOIRE/ressources/"
#downloading winetricks
if [ "`sha1sum < winetricks | sed 's/ .*//'`" != "1bc6af44c8584f01d8e3db0abce6ae869b55e1e4" ]; then
wget http://winezeug.googlecode.com/svn/trunk/winetricks --output-document=winetricks
fi

#installing gecko
POL_SetupWindow_wait_next_signal "Installing Gecko HTML" "$TYTUL"
bash winetricks -q gecko
POL_SetupWindow_detect_exit

#asking for CDROM and checking if it's correct one
POL_SetupWindow_message "Please insert $TYTUL media into your disk drive."
POL_SetupWindow_cdrom
POL_SetupWindow_check_cdrom "SetupUT3.exe"

#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

#starting installation
wine start /unix "$CDROM/SetupUT3.exe"
POL_SetupWindow_message "Click \\"Next\\" when installation will finish." "$TYTUL"
 
cd "$WINEPREFIX/drive_c/windows/temp/"
#setting MouseWarpOverride to force
echo "[HKEY_CURRENT_USER\\\\Software\\\\Wine\\\\DirectInput]" > mwo.reg
echo "\\"MouseWarpOverride\\"=\\"force\\"" >> mwo.reg
regedit mwo.reg

#asking about memory size of graphic card
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"
 
#cleaning temp
cd "$WINEPREFIX/drive_c/windows/temp/"
rm -rf *
 
#making shortcut
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"
 
#asking about patching
POL_SetupWindow_question "Do you want to patch your game?" "$TYTUL"
if [ "$APP_ANSWER" == "TRUE" ] ;then
patch_ut3
fi
 
POL_SetupWindow_Close
exit

Edité par NSLW

GNU_Raziel Mercredi 20 Mai 2009 à 14:53
GNU_Raziel
Admin

Too low fps for this game, it cannot be added to the repository now.
neofox Lundi 9 Janvier 2012 à 12:27
neofoxAnonymous

i have Install UT3 white the script and get now this Problem: