PhoenicisOrg / scripts

Phoenicis scripts
GNU Lesser General Public License v3.0
64 stars 49 forks source link

Script for League of Legends Beta Client #168

Closed madoar closed 7 years ago

madoar commented 7 years ago

I'm thinking about writing a Play on Linux 5 script for League of Legends, based on a review at winehq.

For the script I would choose an OnlineInstallerScript. I know that I can install d3dx9, vcrun2013, vcrun2015 via a preInstall hook:

.preInstall(wine, wizard) {
   wine.d3dx9();
   wine.vcrun2013();
   wine.vcrun2015();
}

My problem is, that I don't know how to install the libraries: msvcp140, vcomp140, vcruntime140 in the script. How can I do that?

qparis commented 7 years ago

The currently available verbs you can install are here: https://github.com/PlayOnLinux/Scripts/tree/master/Functions/Verbs

If you do not find the verb you want, it means that we need to write a script for it :)

madoar commented 7 years ago

Ok, I've just tried creating a script, but it doesn't seem to work as intended, because it "crashes" during the installation either by freezing after pressing on "Install" or with a strange message containing "67108864". I must admit, that my wine knowledge is nearly non-existing which includes the knowledge about the to be installed libraries, which leaves me kind of helpless.

The appended file script.js contains my written script.

plata commented 7 years ago

@madoar msvcp140 etc. belong to vcrun2015. If it doesn't work, it's probably the same error as in #153.

I assume

and added the following libraries: msvcp140, vcomp140, vcruntime140

only refers to setting the correct dll overrides. This is done in the vcrun2015 verb already.

From a first glimpse:

.category("LeagueClient.exe") 

Is probably not what you want. I guess you wanted:

.category("Games") 

I'm not sure about the behavior when doing this. I think it WineShortcut miniature will just fail silently and do nothing. We should probably show some error at this point. @qparis what's your opinion?

You should try to get the installation working without the preInstall first. Or, if really the installation already needs those dlls, try to find a minimal set of verbs needed. Especially, I doubt that the d3dx9 is required.

madoar commented 7 years ago

Oh, yes that was a mistake on my side. During my tests I wondered why my script contained .executable("Games").

I've just tested my script with an out commented preInstall hook, where the script still contains the includes. Afterwards I still got the same error during the installation: league_install_error After pressing on "Ok" a new window is opened, which contains a different number.

plata commented 7 years ago

Just tried it myself. So the error is actually raised by the League of Legends installer and not by Phoenicis. That wasn't clear to me. Maybe it needs Verbs already in the installer.

Could you try the following: Start the installation, then before you get to that point install vcrun etc. via winetricks, then continue.

madoar commented 7 years ago

Ok, I've just tried that, but I still got the same error. What I did was the following:

feanor12 commented 7 years ago

Hi! I'm trying to make a script as well. Do you have your script online somewhere?

madoar commented 7 years ago

@feanor12 nice to hear someone else has interest in a league script too ;) I haven't made a fork of this repository yet, so you can just take the script file I've added here previously: here again the link. Just rename the file again to script.js and change the line .category("LeagueClient.exe") to .category("Games") and you are as far as me ;)

plata commented 7 years ago

@madoar could you try with the recent winetricks from GitHub? Your remarks suggest that the error might be caused by the missing vcrun2015.

madoar commented 7 years ago

@plata I don't think this is the cause, because the old Play on Linux Script, see here, doesn't use vcrun2015 and this is the one I'm basically currently using to successfully play League of Legends, which tells me it (the legacy client at least) is working without vcrun2015.

feanor12 commented 7 years ago

I had to install vcrun2015 to run the betaclient as far as I remember. Also I noticed that --no-sandbox is no longer needed.

plata commented 7 years ago

If you compare your script with the one for PoL4, you can see some differences:

I cannot tell if any of this makes the difference.

madoar commented 7 years ago

Yes, I noticed that too. I didn't try it yet with an older version of wine. About the windows version: I don't know how to change the version in the installation script. Is there a method for that too, or is this more complicated?

feanor12 commented 7 years ago

2.0-staging works with the new client, 2.1 does not(at least for me)

plata commented 7 years ago

It is rather easy. I just noticed that it's missing in the wiki so I added it there.

plata commented 7 years ago

With 2.0-staging, I do not get the error message. However, the install freezes.

madoar commented 7 years ago

Does it freeze on every try? It froze sometimes for me too, but not always. Sometimes I got the message sometimes it froze...

plata commented 7 years ago

Yep. Every try.

plata commented 7 years ago

@qparis do we get the wine log somewhere?

feanor12 commented 7 years ago

Is this correct if i want to set the wine version to 2.0-staging?

.wineVersion("2.0")
.wineArchitecture("x86")
.wineDistribution("staging")
plata commented 7 years ago

Yes. You do not need the architecture as x86 is default, but it doesn't hurt.

plata commented 7 years ago

Seems like the freeze might be caused by a timeout in the downloader due to the issue with playonlinux.com. Maybe it works when the issue is fixed.

feanor12 commented 7 years ago

The PKGBUILD from AUR is doing it in a different way. https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=leagueoflegends They extract the msi directly from the exe. I'm not sure how to do it in PoL ;)

qparis commented 7 years ago

I can confirm that there was an issue with POL.Com yesterday. it is now fixed

plata commented 7 years ago

@feanor12 if you want cabextract, look at IE6.

feanor12 commented 7 years ago

I tried to do it this way now, but it's maybe not the best way to do it ;) https://github.com/feanor12/Scripts/blob/LeagueOfLegendsBeta/Games/League%20of%20Legends/Online/script.js Crashes on login.

feanor12 commented 7 years ago

Login works if i add the following libraries: msvcp140, vcomp140, vcruntime140 The used Verb has an error where it appends .dll to the name

feanor12 commented 7 years ago

Is it possible to create a Shortcut for a file that does not exist yet. If someone runs the launcher a file LeagueClient.exe will be created. The best way to start the Client would be starting LeagueClient.exe directly.

I tried

new WineShortcut()
    .name("League of Legends Client")
    .prefix("LeagueOfLegends")
    .search("LeagueClient.exe")
    .create();     

but it only works if I run it from the console after I updated the Client.

feanor12 commented 7 years ago

If I run the launcher the first time I also see this in the LOL Logs

000000.298| ALWAYS| Trying to connect to app process.
000000.346|  ERROR| ClientWebSocketTransport: Timed out while trying to perform handshake.
000000.346|  ERROR| Unable to connect to app process.
000000.346|   OKAY| Releasing browser process.
000000.346|   OKAY| Shutting down CEF.
000000.358|   OKAY| Exiting ux.     

Any idea on how to fix this?

plata commented 7 years ago

The problem is that WineShortcut searches for the file when you create the shortcut. You could try to create a dummy file. If the launcher does not overwrite it later on, you can delete it in the postInstall step. The other possibility would be to run the launcher as part of the installation so the file is created. We could also consider enhancing WineShortcut in a way which allows you to specify the complete path for the shortcut.

plata commented 7 years ago

Maybe this is the CEF issue which causes trouble when using CEF with wine windows versions > winxp (see bug 38960).

feanor12 commented 7 years ago

I was able to install and play with the following setup

wine.version("2.0"); wine.distribution("staging"); wine.architecture("x86");
wine.corefonts(); wine.sandbox(); wine.d3dx9(); wine.vcrun2015(); wine.windowsVersion("winxp");

  1. run install script
  2. launch lol.launcher.admin.exe (try multiple times, if it does not start)
  3. update to beta
  4. wait for it to finish
  5. add Wineshortcut for LeagueClient.exe via PlayOnLinux console
  6. launch LeagueClient.exe (try multiple times, if it does not start)
  7. wait for it up update (ok at the start but very slow between 40% and 60%)
  8. login
  9. play :)
madoar commented 7 years ago

About the setup, do I need to add it to my "old" script or to your newer one in your fork (or did you already add it there)?

feanor12 commented 7 years ago

I used the script in my fork ( https://github.com/feanor12/Scripts/blob/LeagueOfLegendsBeta/Games/League%20of%20Legends/Online/script.js ) , but I did not try to remove corefonts and sandbox. I think the one in master almost works just add d3dx9, corefonts, sandbox, windowsVersion("winxp") The shortcut for the Client can be found at the bottom of the forked script.

plata commented 7 years ago

I did the one in master to show a way which utilizes QuickScript (instead of writing the complete installation manually). Feel free to enhance it as you need (e.g. add missing verbs). You should, however, install only verbs which are really needed.

For the shortcut: You could try to create a link called "LeagueClient.exe" which points to "lol.launcher.admin.exe" in the place where the launcher creates the real exe later on.

feanor12 commented 7 years ago

This does not work:

 new CustomInstallerScript() 
...
.postInstall(function(wine,wizard) {
      var launcher = wine.prefixDirectory+"drive_c/LoL/lol.launcher.admin.exe"
      var client = wine.prefixDirectory+"drive_c/LoL/LeagueClient.exe"
      lns(launcher,client)
     })
.executable("LeagueClient.exe")

@plata Is it possible to run the shortcut creation(executable) after postInstall or maybe add a hook between install and shortcut-creation. If not I have to do it with the WineShortcut class.

madoar commented 7 years ago

Just a short question: Am I right, that the "launcher" is the legacy client and the "client" is the beta client? If yes I would suggest to add this to the shortcut labels.

feanor12 commented 7 years ago

The launcher, i think, did the patching for the legacy client. The new client does not need the launcher as far as I understand. It is just needed to upgrade to the beta client, as it is not the default yet.

plata commented 7 years ago

@feanor12 can't you create a file LeagueClient.exe in preInstall so WineShortcut can find it and then create the link in postInstall? It's all quite hacky but I'm not really sure how we should deal with shortcuts which do not exist after installation (or if that is even a common use case). The shortcut creation could be done in the end but @qparis said it should be done as early as possible.

feanor12 commented 7 years ago

I did a pull request just now ;)

177

feanor12 commented 7 years ago

I think we can close this.

madoar commented 7 years ago

I've tried the new League of Legends Script. I'm not sure if I would say it's "ready for production" because at least for it gave me 2 or 3 bugsplats during the installation and afterwards it freezes quite often, which forces me to kill the league processes and restart the client. In addition, it's currently not possible to choose the language of the client during the installation process, I believe that would be quite useful.

madoar commented 7 years ago

On another note: every time I want to start the league client I'm unsure, which of the two created shortcuts I should use. It would be nice to enrich the shortcuts with a bit more information what application exactly is started after I've clicked onto it.

In addition to this I'm kind of fearful to click the remove/uninstall button for one of the shortcuts, because I'm unsure what happens afterwards. Gets only the shortcut removed or the application behind it too?

plata commented 7 years ago

@madoar could you open new issues for the different problems? I think it will get lost here.

Regarding the language selection: This is caused by the "/q" option for the installation. If you remove this, you should see the installation windows.

You will always be asked if you want to remove the complete container. If you have more than one shortcuts, only the shortcut should be removed (not the application).