[HOWTO][Unreal Anthology] Installing UT2004 and more...

Need help with one of the installers?
Post Reply
Triton

[HOWTO][Unreal Anthology] Installing UT2004 and more...

Post by Triton » Sat Apr 21, 2007 20:10

Colors signification.
READ ABSOLUTELY.
Download before starting.
Paths and files.

NB 1: Excuse my English, I'm French :wink:
NB 2: Be careful, the script has been splitted in order to make it more readable. Some variables set in the first part are used in the remaining ones. If you copy these commands in a shell, be sure to do it in the same because only this one know the value of INSTALLDIR, TMPDIR, etc... and because I sometimes assume that I am in the good directory.
NB 3: Do NOT simply execute the script without understanding it precisely. I did NOT try to execute it in one shot since I made it step by step.
NB 4: I can NOT be taken as responsible ... blah-blah-blah. :twisted:
NB 5: I made the script more or less generic but I don't even know if the other Unreal games can be installed in the same way.
TIP: Read the whole tutorial first. Then, download any file you'll need before you can restart from scratch and act. (Sometimes, I should follow my own advices. :roll: )

I managed to install UT2004 with the Unreal Anthology DVD using this tutorial and this one and want to add some precisions and improvements.

The first steps can be accelerated in the following way (I assume that the DVD is already mounted on /media/dvd and that unshield is installed).

First, we set all needed paths and the language.

Code: Select all

DVD_UA="/media/dvd"
TMPDIR="/tmp/UNREAL_ANTHOLOGY_`whoami`"
INSTALLDIR="/opt/ut2004"
PATCHDIR="~/downloads" # Where the patch will be download
LANGUAGE="French" # Other translations are English German Italian and Spanish
Note that Unreal (Gold) is only in English. The language part is useless.
You can adapt the above variables following your configuration.

Now, we will prepare the extraction. No need to copy the .hdr and .cabs files, we just create symlinks on them.

Code: Select all

mkdir -p "${TMPDIR}"
cd "${TMPDIR}"
for i in ${DVD_UA}/Disk*/data*.*; do
  ln -s "${i}" .
done
Then, we extract the whole cab... (You need at least 12.5 Go free for this operation).

Code: Select all

mkdir -p "${INSTALLDIR}"
unshield -d "${INSTALLDIR}" x "${TMPDIR}/data1.cab"
And clean the temporary files.

Code: Select all

rm -f ./data*.*
cd "${INSTALLDIR}"
rmdir "${TMPDIR}"
We can now clean the useless files just extracted.
I should really search for the good options to extract only the usefull files. :?

Code: Select all

rm -Rf _* Launcher* All_UT2004.EXE *_EXE OCXFiles
rm -Rf 1_UnrealGold_* # Comment it if you plan to install Unreal Gold
rm -Rf 2_Unreal2_* # Comment it if you plan to install Unreal II : The Awakening
rm -Rf 3_UnrealTournament_* # Comment it if you plan to install Unreal Tournament GotY Edition
# rm -Rf 4_UT2004_* # Uncomment it if you do NOT plan to install Unreal Tournament 2004
Next, we'll have to reduce the folder name to the normal UT2004 naming scheme.

Code: Select all

ls -d 4_UT2004_* | sed 's/^4_UT2004_\(.*\)$/mv & \1/' | bash
Update: Here is a BAD method to choose your language, see below the update.

We just want to install our preferred language.

Code: Select all

ls -1d *_All | sed 's/\(.*\)_All$/\[ -d \1 \] \&\& mv &\/* \1\/ || mv & \1/' | bash
If Directory and Directory_All both exist, copy all files from Directory_All in Directory, else, rename Directory_All in Directory.

Code: Select all

ls -1d *_${LANGUAGE}* | sed "s/\(.*\)_${LANGUAGE}\(All\|\)$/\[ -d \1 \] \&\& mv &\/* \1\/ || mv & \1/' | bash
Same thing with Directory and Directory_Language except that German sometimes appears as GermanAll. Don't ask me for explanations, I don't understand either.

Update: This method really was the crap one. You should not use it unless you disk space is really low. On the other hand, I didn't try the clean method and do not know if it works well. :shock:

The clean method is the following: Replace

Code: Select all

Language=int
in ${INSTALLDIR}/System/Default.ini by

Code: Select all

Language=frt
This set globally French as Default language.
Use ~/.ut2004/System/UT2004.ini to change the language for one user only.
Replace frt by itt for Italian, est for Spanish and det for German. I'm not certain about the languages but it seems logical considering the content of (and extensions in) ${INSTALLDIR}/System.

The next part is the installation of the executable (ut2004-bin).
Problem: It is not present in the Midway Anthology DVD.
Solution: Install the megapack which contains the last patch (3369 as of now) and, as a consequence, the Linux executable.
You can find the MegaPack here, it also includes the Editor's Choice Edition bonus pack plus 9 new maps.
You should also download the 3369-2 patch (includes the second version of 3369 patch, not the new maps) which is available here and fix a security issue.

WARNING: The MegaPack contains the 3369.1 patch, not the 3369.2 so it must be installed before. If you installed it after, don't panic, just reinstall the 3369.2 patch.

Now you should be prepared for the last part of this manual install. :D

MegaPack installation is accelerated by extracting directly the files in the good directory.
${PATCHDIR}/UT2004MegaPack must NOT exist.

Code: Select all

cd "${PATCHDIR}"
ln -s ${INSTALLDIR} UT2004MegaPack
tar --no-overwrite-dir -tjvf ut2004megapack-linux.tar.bz2
rm -f UT2004MegaPack
Same remark as above for ${PATCHDIR}/UT2004-Patch

Code: Select all

ln -s ${INSTALLDIR} UT2004-Patch
tar --no-overwrite-dir -tjvf ut2004-lnxpatch3369-2.tar.bz2
rm -f UT2004-Patch
Even if we've got the executable now, we can't run the game because the libraries are not found by ut2004, so we will indicate their location.

Code: Select all

cd ${INSTALLDIR}/System
ln -sf /usr/lib/libopenal.so openal.so
ln -sf /usr/lib/libSDL-1.2.so.0 libSDL-1.2.so.0
Assuming /usr/lib/libopenal.so and /usr/lib/libSDL-1.2.so.0 exist.
If necessary, you can find them with:

Code: Select all

find / -name libSDL-1.2.so.0 -o -name openal.so
Then, we prepare the install for playing and for the installation of any future add-on installed with a Loki installer. We could have installed the MegaPack this way (with the automatic installer) but since the 3369.2 patch do not have an installer (yet ?) I took the quick'n'not-so-dirty way for both packs.
Copy following code in ${INSTALLDIR}/ut2004 (ut2004 is the filename) and make it executable.

Code: Select all

#!/bin/sh

SUBDIR="."

#----------------------------------------
script=$0
count=0

while [ -L "$script" ]
do
script=`perl -e "print readlink(\"$script\"), \"\n\""`
count=`expr $count + 1`

if [ $count -gt 100 ]
then
echo "Too many symbolic links"
exit 1
fi
done

GAME_DIR=`dirname $script`

cd $GAME_DIR
cd System
./ut2004-bin "$@"
You can make a symlink on this file in a directory that is in the PATH.

Code: Select all

ln -s "${INSTALLDIR}/ut2004" /usr/local/bin/ut2004"
Copy following code in ~/.loki/installed (installed is the filename, ~ is the home directory of the user that install the mods (usually root) and which have the rights to.

Code: Select all

<?xml version="1.0"?>
<product name="ut2004" desc="Unreal Tournament 2004" xmlversion="1.6" root="INSTALL_DIR" update_url="http://unreal.epicgames.com/updates/ut2004/updates.txt">
  <component name="__CDKEY__" version="3369" default="yes">
    <option name="English"></option>
    <option name="__CDKEY__" tag="__CDKEY__"></option>
  </component>
</product>
Remember to replace INSTALL_DIR by the value of INSTALLDIR.

Now, you should be able to play!

Code: Select all

ut2004
Any remark, correction, question is welcome...

Post Reply