Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # Author: Danilo Riffo (aka. DanAlucard)
- # License: GPL v3
- #
- # made for own usage and for the WineHQ - League of Legends community
- #
- #
- scriptWD=$(pwd)
- #################################################################################
- #download and extract the wine source #
- #################################################################################
- echo "downloading wine source..."
- wget http://downloads.sourceforge.net/project/wine/Source/wine-1.5.7.tar.bz2
- echo "extracting wine source..."
- tar -xjf wine-1.5.7.tar.bz2 && mv wine-1.5.7 $HOME/wine-1.5.7
- #################################################################################
- #variable that we will need to compile and configure wine #
- #################################################################################
- WINEPREFIX=$HOME/LoL_wine
- #################################################################################
- #prepare wine to be compiled #
- #################################################################################
- echo "going into $HOME/wine-1.5.7"
- cd $HOME/wine-1.5.7
- echo "downloading Wine patches, so it can properly run LoL..."
- wget http://uz.sns.it/~ranma42/iLoL/spectator-fix-v3/0001-ntdll-Improve-performace-of-heap-allocation-v2.patch -O patch1.patch
- wget http://uz.sns.it/~ranma42/iLoL/spectator-fix-v3/0002-imm32-Avoid-deadlock-when-destroying-thread-data-v2.patch -O patch2.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
- echo "download complete. Patching wine..."
- patch -p1 < patch.patch
- patch -p1 < patch1.patch
- patch -p1 < lol-store-1.patch
- patch -p1 < lol-store-2.patch
- patch -p1 < lol-store-3.patch
- #################################################################################
- #configure and compile: #
- #################################################################################
- echo "configuring wine..."
- ./configure --prefix=$WINEPREFIX
- echo "I'm going to compile wine."
- echo "It will take a while, so close all your applications, press enter and go to drink something..."
- read $foo
- echo "compiling wine..."
- make -j2 #this makes 'make' to have 2 jobs (use 2 CPU cores). For muti-core CPUs this is just awesome.
- echo "installing wine into $WINEPREFIX"
- make install #this installs wine into WINEPREFIX directory.
- #################################################################################
- #prepare the wineprefix environment #
- #################################################################################
- echo "preparing the Wine Prefix environment..."
- export WINEPREFIX=$HOME/LoL_wine/LoL_Prefix #directory where we want to create the wineprefix
- WINEXE=$HOME/LoL_wine/bin/wine #location of wine executable
- $HOME/LoL_wine/bin/winecfg #run winecfg to create the wineprefix
- winetricks d3dx9 vcrun2005 vcrun2008 wininet corefonts ie6 win7
- # if you have the web-based installer, use this
- echo "running LoL Installer..."
- GC_DONT_GC=1 $WINEXE $scriptWD/LeagueofLegends.exe
- # if you are not using the web-based installer comment all the previous block until here.
- # if you have the full installer, uncomment and use this two lines:
- #echo "running LoL Installer..."
- #$WINEXE $scriptWD/LoL_installer/setup.exe #LoL full installer is suposed to be on the same directory as this script, into
- #the LoL_installer folder. Change this command to point into the real location
- #of the installer if you don't want to move or rename the folder ;)
- #################################################################################
- #create the loltask script to optimize LoL threading #
- #################################################################################
- echo "creating loltask thread optimizer for LoL..."
- echo "#!/bin/bash
- OLDPID='a'
- INFINITEBUCLE='yes'
- until [ $INFINITEBUCLE = 'no' ]; do
- LOLPID=\`ps -A | grep -m 1 'League of Legen' | awk '{print $1}'\`
- WINESVRPID=\`ps -A | grep -m 1 'wineserver' | awk '{print $1}'\`
- WINEDEVPID=\`ps -A | grep -m 1 'winedevice.exe' | awk '{print $1}'\`
- if [ ! $LOLPID ]; then
- echo 'League of Legends is not running'
- elif [ $OLDPID != $LOLPID ]; then
- OLDPID=$LOLPID
- taskset -p 1 $LOLPID
- renice -n -10 $LOLPID
- renice -n -10 $WINESVRPID
- renice -n -10 $WINEDEVPID
- else
- echo 'League of Legends is already tuned.'
- fi
- sleep 15
- done
- " > ./loltask
- # change kdesu to gksu if u don't use KDE
- kdesu mv ./loltask /usr/bin/loltask
- kdesu chmod +x /usr/bin/loltask
- #################################################################################
- #now, we're ready to create the launcher #
- #################################################################################
- echo "creating the launcher..."
- echo "#!/bin/bash
- export WINEPREFIX=\$HOME/LoL_wine/LoL_Prefix #directory where we want to create the wineprefix
- WINEXE=\$HOME/LoL_wine/bin/wine #location of wine executable
- cd \$WINEPREFIX/drive_c/Riot\ Games/League\ of\ Legends/RADS/system/
- \$WINEXE \"rads_user_kernel.exe\" run lol_launcher \$(ls ../projects/lol_launcher/releases/) LoLLauncher.exe &
- loltask_instance=\$(ps -A | grep loltask)
- if [ ! "\$loltask_instance" ]; then
- # change kdesu to gksu if u don't use KDE
- kdesu loltask &
- else
- echo "loltask is already started. You don\'t want it to be started again \;\)"
- fi
- " > $HOME/Desktop/Play_LeagueOfLegends.sh
- chmod +x $HOME/Desktop/Play_LeagueOfLegends.sh
- #################################################################################
- #clean the mess I've done #
- #################################################################################
- echo "removing temporary files..."
- rm -R $HOME/wine-1.5.5
- rm $scriptWD/wine-1.5.7.tar.bz2
- #################################################################################
- #finalize #
- #################################################################################
- echo "LoL build completed!"
- echo ""
- echo ""
- echo "to play League of Legends just double click the icon in your desktop ;)"
- echo ""
- echo ""
Add Comment
Please, Sign In to add comment