forked from mattcaron/playonlinux
-
Notifications
You must be signed in to change notification settings - Fork 10
/
League Of Legends-pmb
167 lines (126 loc) · 7.01 KB
/
League Of Legends-pmb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#!/bin/bash
# Date : (2012-04-12)
# Last revision : (2013-04-29 20:04)
# Distribution used to test : ArchLinux, Debian Sid
# Author : Quentin PÂRIS, Valentin PERRUSSEL, Pierre ETCHEMAITE
# Licence : GPLv3
# PlayOnLinux: 4.1.10-dev
# WineHQ: http://winebuild.playonlinux.com/wine/wine-patches/LeagueOfLegends/
# Changelog
# (2012-05-11) 22:50 - Quentin PÂRIS
# - New wine patches for better perfomances
# (2012-05-11) 23:38 - Quentin PÂRIS
# - Dirty hack that fixes problems
# (2012-05-12) 09:45 - Quentin PÂRIS
# - Patches for osx
# (2012-05-28) 11:00 - Quentin PÂRIS
# - Checks for recent version of PoL (InsertBeforeWine is bad supported by 4.0.14)
# (2013-03-10) 22:51 - Pierre ETCHEMAITE
# - Use web downloader
# (2013-04-13) 20:12 - GNU_Raziel
# - Added POL_Wine_SetVideoDriver function
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
WINEVERSIONP2P="1.5.12-LeagueOfLegendsShop"
WINEVERSION="1.5.24-LeagueOfLegendsShop"
TITLE="League of Legends"
PREFIX="LeagueOfLegends"
SHORTCUT_NAME="League of Legends"
POL_GetSetupImages "http://files.playonlinux.com/resources/setups/$PREFIX/top.jpg" "http://files.playonlinux.com/resources/setups/$PREFIX/left.jpg" "$TITLE"
POL_SetupWindow_Init
POL_RequiredVersion "4.0.18" || POL_Debug_Fatal "$APPLICATION_TITLE 4.0.18 is required to install $TITLE"
which glxinfo || POL_Debug_Error "$(eval_gettext 'glxinfo is not installed. Please install mesa-utils package')"
if ! glxinfo | grep -q GL_EXT_texture_compression_s3tc; then
POL_SetupWindow_message "$(eval_gettext 'Warning! S3TC compression is not available on your system.\n\nIf you have a free driver, you might need to install a proprietary driver \n\nOtherwise, you can enable it by installing libtxc-dxtn0 package, but you might get slower results')"
POL_Debug_Warning "S3TC not enabled!"
fi
POL_Debug_Init
POL_SetupWindow_presentation "League of Legends" "Riot" "http://www.riotgames.com/" "Quentin PÂRIS, BlondVador" "LeagueOfLegends"
POL_SetupWindow_InstallMethod "DOWNLOAD,LOCAL"
if [ "$INSTALL_METHOD" = "LOCAL" ]; then
cd "$HOME"
POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run.')" "$TITLE" "" "Windows Executables (*.exe)|*.exe;*.EXE"
if strings "$APP_ANSWER"|grep -q 'name="Pando Media Booster Downloader"'; then
# The user actually selected the downloader, not the installer!
INSTALL_METHOD="DOWNLOAD"
DOWNLOADER="$APP_ANSWER"
else
FULL_INSTALLER="$APP_ANSWER"
fi
else # DOWNLOAD
POL_SetupWindow_menu "$(eval_gettext 'What version would you like to install?')" "$TITLE" "EU West~Brasil~EU Nordic & East~North America~Turkey" "~"
case "$APP_ANSWER" in
"EU West") DOWNLOAD_URL="http://l3cdn.riotgames.com/Installer/EUW_Installer/LeagueofLegends.exe";;
"Brasil") DOWNLOAD_URL="http://l3cdn.riotgames.com/Installer/BR_Installer/LeagueofLegends.exe";;
"EU Nordic & East") DOWNLOAD_URL="http://l3cdn.riotgames.com/Installer/EUNE_Installer/LeagueofLegends.exe";;
"North America") DOWNLOAD_URL="http://l3cdn.riotgames.com/Installer/NA_Installer/LeagueofLegends.exe";;
"Turkey") DOWNLOAD_URL="http://l3cdn.riotgames.com/Installer/TR_Installer/LeagueofLegends.exe";;
esac
POL_System_TmpCreate "$PREFIX"
cd "$POL_System_TmpDir"
POL_Download "$DOWNLOAD_URL"
DOWNLOADER="$POL_System_TmpDir/LeagueOfLegends.exe"
fi
POL_System_SetArch "x86"
POL_Wine_SelectPrefix "$PREFIX"
if [ "$INSTALL_METHOD" = "DOWNLOAD" ]; then
POL_Wine_PrefixCreate "$WINEVERSIONP2P"
else
POL_Wine_PrefixCreate "$WINEVERSION"
fi
POL_Call POL_Install_vcrun2005
POL_Call POL_Install_vcrun2008
POL_Call POL_Install_corefonts
POL_Call POL_Install_d3dx9
POL_Call POL_Install_wininet
Set_OS "win7"
if [ "$INSTALL_METHOD" = "DOWNLOAD" ]; then
# Try to avoid running out of file descriptors, set soft ulimit as high as possible
ulimit -Sn hard
# Add Pando Media Booster to control panel
ln -sf "$WINEPREFIX/drive_c/$PROGRAMFILES/Pando Networks/Media Booster/PMB.cpl" "$WINEPREFIX/drive_c/windows/system32/"
FULL_INSTALLER_DIR=""
# Sadly, no guarantees, as nobody but root can increase "hard" ulimits.
# So be prepared to retry
while true; do
POL_Wine_WaitBefore "$TITLE"
GC_DONT_GC=1 POL_Wine --ignore-errors "$DOWNLOADER"
DOWNLOADER_EXITCODE=$?
# The downloader starts the full installer when it's done,
# OR the p2p download saturated wineserver fds until it crashed.
# Either way, kill everything including Pando Media Booster in background.
wineserver -k
if [ -z "$FULL_INSTALLER_DIR" ]; then
FULL_INSTALLER_DIR="$(POL_Wine winepath -u "$(iconv --from-code UTF-16 --to-code UTF-8 "$WINEPREFIX/drive_c/users/$USER/Temp/LeagueOfLegends.exe.log"|sed -n 's/^.*:main:D:Saving to \(.*\)\r/\1\/League of Legends/p')")"
POL_Debug_Message "P2P download target: $FULL_INSTALLER_DIR"
fi
FULL_INSTALLER="$FULL_INSTALLER_DIR/setup.exe"
# downloader reported success?
[ $DOWNLOADER_EXITCODE -eq 0 ] && break
# or it didn't but everything seems to be downloaded?
[ -e "$FULL_INSTALLER" -a "$(echo "$FULL_INSTALLER_DIR"/*.downloading)" = "$FULL_INSTALLER_DIR/*.downloading" ] && break
POL_SetupWindow_message "$(eval_gettext 'Downloader crashed, likely because it opened more files than allowed. It will be restarted in the hope it completes its job.')" "$TITLE"
done
# LoL is now safely downloaded with a version that doesn't freeze during P2P
# Switching to a version that works better during play
POL_Wine_InstallVersion "$WINEVERSION"
POL_Wine_SetVersionPrefix "$WINEVERSION"
fi
POL_SetupWindow_message "$(eval_gettext 'Warning: You must not tick the checkbox "Run $TITLE" when setup is done')" "$TITLE"
POL_Wine_WaitBefore "$TITLE"
GC_DONT_GC=1 POL_Wine "$FULL_INSTALLER"
Set_OS winxp
# Set Graphic Card informations keys for wine
POL_Wine_SetVideoDriver
POL_Shortcut "rads_user_kernel.exe" "$SHORTCUT_NAME" "$SHORTCUT_NAME.png" "run lol_launcher 0.0.0.0 LoLLauncher.exe" "Game;RolePlaying;"
POL_Shortcut_InsertBeforeWine "$SHORTCUT_NAME" 'rm "$WINEPREFIX/drive_c/Riot Games/League of Legends/RADS/projects/lol_launcher/releases/0.0.0.0" 2> /dev/null'
POL_Shortcut_InsertBeforeWine "$SHORTCUT_NAME" 'ln -s "$WINEPREFIX/drive_c/Riot Games/League of Legends/RADS/projects/lol_launcher/releases/$(ls -1 "$WINEPREFIX/drive_c/Riot Games/League of Legends/RADS/projects/lol_launcher/releases/" | tail -n 1)" "$WINEPREFIX/drive_c/Riot Games/League of Legends/RADS/projects/lol_launcher/releases/0.0.0.0"'
POL_Shortcut_InsertBeforeWine "$SHORTCUT_NAME" 'rm "$WINEPREFIX/.update-timestamp"'
if [ "$INSTALL_METHOD" = "DOWNLOAD" ]; then
# Uninstall Pando Media Booster?
#POL_Wine "$WINEPREFIX/drive_c/$PROGRAMFILES/Pando Networks/Media Booster/uninst.exe"
POL_System_TmpDelete
POL_SetupWindow_message "$(eval_gettext 'You should now have a League of Legends directory containing its installer. You may keep it to speed up reinstallations.')" "$TITLE"
fi
POL_SetupWindow_Close
exit 0