Taylorbyte.com

Documentation Wiki

LoL (League of legends) with wine

NOTE: THIS GUIDE IS CURRENTLY OUT OF DATE. WHEN WINE REQUIRES PATCHES TO RUN LEAGUE OF LEGENDS IT MAY BE UPDATED AGAIN.

NOTE 2: The git instructions will probably work to build the latest wine. Just skip the part about patches.

This wiki includes instructions to build a second wine in "/opt/wine-lol" with a patches that are required to run LoL. The patches can stop other games or applications from running, that is the reason for seperating this second wine keeping the original wine untouched.

Git clone wine

Create wine directory in /usr/src/ ready to git clone wine

mkdir -p /usr/src/wine/wine-git
cd /usr/src/wine/

Start cloning from wine repo

git clone git://source.winehq.org/git/wine.git /usr/src/wine/wine-git

Resetting your wine tree to the default state

If you have applied patches before and want to revert back to apply new patches, do this:

cd /usr/src/wine
rm *.patch
rm -rf wine-lol
cd wine-git
git checkout master
git reset --hard
git clean -f
git pull
git branch -D wine-lol

Download patches

Download the following patches

wget http://uz.sns.it/~ranma42/iLoL/spectator-fix-v3/0001-ntdll-Improve-performace-of-heap-allocation-v2.patch -O lol-performance-patch.patch
wget http://uz.sns.it/~ranma42/iLoL/spectator-fix-v3/0002-imm32-Avoid-deadlock-when-destroying-thread-data-v2.patch -O lol-imm-patch.patch
wget http://bugs.winehq.org/attachment.cgi?id=39446 -O lol-store-1.patch
wget http://bugs.winehq.org/attachment.cgi?id=39447 -O lol-store-2.patch
wget http://bugs.winehq.org/attachment.cgi?id=39449 -O lol-store-3.patch

Apply patch and create a new git branch

This will make updating easier in the future

cd wine-git
git checkout `git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags | tail -n 1` -b wine-lol
patch -p1 < ../lol-imm-patch.patch
echo "Wine imm patch (spectator fix) for LoL" | git commit -a -F -
patch -p1 < ../lol-performance-patch.patch
echo "Wine performance patch (spectator fix) for LoL" | git commit -a -F -
patch -p1 < ../lol-store-1.patch
echo "Wine store patch for LoL" | git commit -a -F -
patch -p1 < ../lol-store-2.patch
echo "Wine store patch for LoL" | git commit -a -F -
patch -p1 < ../lol-store-3.patch
echo "Wine store patch for LoL" | git commit -a -F -
cd ..

Update wine to the latest release

You do not need to keep re-applying patches if you update this way, this also picks the latest released version.

cd wine-git
git checkout master
git pull
git checkout `git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags | grep -v rc | tail -n 1` -b wine-lol-temp
git checkout wine-lol
git rebase wine-lol-temp wine-lol
git branch -d wine-lol-temp
cd ..

Build wine-lol

  • configure prefix to install wine-lol to /opt/wine-lol away from other apps and normal wine
  • make
  • make install
  • this does an out of tree build so it will not interfere with wine-git
rm -rf wine-lol
mkdir wine-lol
cd wine-lol
../wine-git/configure --prefix=/opt/wine-lol
make -j8
make install
cd ..

Automatic update and build script

To save yourself some work, here is an update script. You can use this for the inital build straight after applying the patches above.

cd /usr/src/wine
cd wine-git
git checkout master
git pull
git checkout `git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags | grep -v rc | tail -n 1` -b wine-lol-temp
git checkout wine-lol
git rebase wine-lol-temp wine-lol
git branch -d wine-lol-temp
cd ..
rm -rf wine-lol
mkdir wine-lol
cd wine-lol
../wine-git/configure --prefix=/opt/wine-lol
make -j8
make install
cd ..
version=`/opt/wine-lol/bin/wine --version`
echo "Wine version $version is now installed"

Prepare wine prefix as normal user

Install winetricks into LoL wine prefix. Make sure windows 7 is on the end as ie6 will not install in windows 7 mode. Windows 7 improves the framerate. IE8 breaks the login.

WINEPREFIX=~/.wine-lol winetricks d3dx9 vcrun2005 vcrun2008 wininet corefonts ie6 win7

Installing League of Legends

Download and run the installer. This is the north america installer

wget http://l3cdn.riotgames.com/Installer/NA_Installer/LeagueofLegends.exe
GC_DONT_GC=1 wine LeagueofLegends.exe

Running League of Legends

Create script to run the official riot LoL using the custom wine-lol:

  • Uncomment the find line if you have lots of ram and would like to preload LoL for faster loading
cat > ~/LoL << EOF
#!/bin/sh
cd ~/.wine-lol/drive_c/Games/League\ of\ Legends/RADS/system/
WINEPREFIX=~/.wine-lol \
PATH=/opt/wine-lol/bin:$PATH \
#find ~/.wine-lol/drive_c/Games/League\ of\ Legends -type f -exec cat {} \; > /dev/null &
wine "rads_user_kernel.exe" run lol_launcher $(ls --color=never ../projects/lol_launcher/releases/) LoLLauncher.exe
cd
EOF
chmod +x ~/LoL