moraroy / NonSteamLaunchers-On-Steam-Deck

Installs the latest GE-Proton and Installs Non Steam Launchers under 1 Proton prefix folder and adds them to your steam library. Installs... Battle.net, Epic Games, Ubisoft, GOG, EA App, Amazon Games, itch.io , Legacy Games, The Humble Games Collection, IndieGala, Rockstar Games Launcher,PS Plus, Glyph, VKPlay & HoYoPlay. SD Card Support and Games.
https://github.com/sponsors/moraroy
MIT License
2.62k stars 46 forks source link

Unable to complete login process for Humble Bundle #79

Open khowe085 opened 1 year ago

khowe085 commented 1 year ago

On a freshly imaged Deck I ran the script and Install the Humble Bundle app. The browser popped open, I entered my credentials and it asked to open a link and I said yes. After that nothing was happening, and when I clicked try again it asked me to choose an application, but "Humble (Login)" was not an option.

I had the option to pick an application using a file picker so I pointed it Home/.local/share/applications/Humble-scheme-handler.desktop' and compatdata/NonSteamLaunchers/pfx/handle-humble-scheme and it still wasn't working. I eventually set it to 'Use system handler (default)" and started looking through the github changelogs.

I noticed that the handle-humble-shcheme was trying to call /steamapps/common/proton - expirmental/proton, but the compatibility level set by the install script had set the version for humble app to GE - 8.4, and I hadn't launched any other app yet that used proton expirimental so it hadn't been downloaded.

I changed humble app to use proton-expirmental, but it still isn't completing the login process. I can see that it is writing to the file pfx/drive_c/.auth, but it doesn't look like it is running the command. When I tried running proton run ~/.local/share/Steam/steamapps/compatdata/APPID/pfx/start-humble.cmd in Konsole, I got an error message saying there was no compat data folder.

I also notice that in the commit that fixed HUmble app last time, the target executable was changed to onSteamLaunchers/pfx/start-humble.cmd, but the installer had set it to HUmble App.exe. I changed this in the properties, and the app launched fine... but I still couldn't login.

The last thing I tried was adding the start-humble-cmd as a second non-steam game and then launching that right after I completed the login process and it wrote the auth file, but that didn't work either.

khowe085 commented 1 year ago

I noticed "APPID" in my post as soon as I clicked send, and also I was trying to do the proto run command in BASH and not sh. I opened Konsole, switched to sh, and tried to run the command and got the missing compat data path error again. After some googling, I realized I needed to call the two export commands I had seen in the last commit. I ran those, did the login process and and then was successful in having proton run the start-humble.cmd.

A window opened and closed quickly, but I the login process is still not completing

khowe085 commented 1 year ago

I 'started' fresh with version 2.88 and only installed Humble app, and with this version after I click 'Allow Access', I get a system dialog that asks me to select an application to open 'x-shceme-handler/humble'. There is an option to Select 'Humble App (Login)', but selecting it does not complete the login process

moraroy commented 1 year ago

Thank you for troubleshooting this!! @Zoullx would know more than me on how this works, what do you think bro?

khowe085 commented 1 year ago

Sorry for the incoherent ramblings, I'm new to linux and was fighting with that for a few hours past when I probably should've gone to bed lol.

I did one more full wipe and had the same experience as my last post using 2.88, It got passed to the system handler which asked me to pick an app, and then nothing happened.

It seems Firefox has it's own 'Choose Application' which is different than the system's 'Choose Application'. Firefox initially asked to 'Open link', then subsequent tries it asked to 'Choose Application'. When Firefox is set to 'System handler', I will sometimes get the system dialog that contains 'Humble App (Login)'. I'm assuming what I'm calling the system dialog is actually the 'xdg' application?

Either way... it looks like the code wants to execute Humble App.exe pointed at a file created by the handler of the URL Firefox is handing off to the system and the call to that exe is silently failing somwhere

Zoullx commented 1 year ago

Sorry I didn't respond right away, my wife and I have been working on buying a house and selling our house and taking care of everything that's involved with that.

As for how the process works, let me see if I can explain it well enough that you fully understand what all you can look at and try in order to fix your issues. When click login from the Humble App, it opens your default browser so that you can go through the authentication process. After you login in the browser and click Allow, what's happening in the background is that the browser is trying to open a humble:// deep link and by default there's no app installed on the Steam Deck that can handle these deep links. That's what the Humble-scheme-handler.desktop app is used for, when that xdg-open Choose Application Dialog is asking you to choose an application, it's asking you to choose an application to handle humble deep links. There is another way to set this from Konsole in case you messed up something there which I will discuss later. But all the Humble-scheme-handler.desktop app is really doing is calling something else, it's essentially just used like a shortcut, it's actually calling the handle-humble-scheme script and passing some parameters to it, which is basically your authentication code. And really, the handle-humble-scheme script is really only used in the authentication process, as we are taking that code and writing it to the .auth file. Then we are using the Proton compatibility layer to run the windows start-humble.cmd script. Then in that script we are checking to see if we are trying to authenticate by checking to see if the .auth file exists and if it does we are passing that code to the Humble App. It's the passing of that code to the Humble App that ends up getting you logged in.

This is essentially the same process that Lutris uses in order to authenticate and login to the Humble App, but since we aren't using the wine compatibility layer directly like Lutris and are trying to use Proton directly, I ended up making some assumptions because I couldn't figure out how to do some things from the command line. The main assumption that I made is that you're forcing compatibility with Proton Experimental for the Humble App in Steam. So this is one of the first places where you could try something, in that you could either make sure that you have Proton Experimental installed and are forcing compatibility with it for the Humble App in Steam, or you could figure out what version of Proton you have set as your default and use that path in the handle-humble-scheme script. Also, in terms of the handle-humble-scheme script, the APPID in the paths in that file are used as a replacement from the main installer script depending on whether or not you chose Separate App IDs. If you did not choose Separate App IDs, then APPID will be replaced with NonSteamLaunchers, if you did choose Separate App IDs, then APPID will be replaced with HumbleGamesLauncher. A note to mention here, is that I only believe that the Proton chosen to be used with the Humble App and the one used to run the start-humble.cmd script in the handle-humble-scheme script need to be the same, I haven't actually verified that, so you might not actually need to make sure that they are the same. That just 'seemed' to be the experience that I had. The other thing that you can try is manually setting the humble:// deep link handler from Konsole using this command xdg-mime default Humble-scheme-handler.desktop x-scheme-handler/humble. But in doing this, you may or may not have to rebuild the mime info cache using this command update-mime-database $HOME/.local/share/applications/.

I think that's about it. Something that I would like to add is why we end up using the start-humble.cmd script. Along with passing the authentication code to the Humble App, there are times when a url is passed to the Humble App in order to go directly to a game page, etc. Using the start-humble.cmd script is essentially the only way that we can make sure that things like that actually get passed to the Humble App.

In terms of the specific issue that you are having, if I had to guess, my guess would be that it's the Proton that the handle-humble-scheme script is trying to use to call the start-humble.cmd script. I don't like the fact that I made the assumption to use Proton Experimental, but I haven't figured out a way to determine if a specific Proton version is being forced to be used with the Humble App, or even what the default Proton for the system is set to from the command line. If I can figure out how to determine those things, then what I would do is first check if a Proton version is being forced for the Humble App and if so use that and if not then get the default Proton version for the system and use that. Until then, I wanted to at least get something in place.

Sorry, for the novel, but I hope this helps, good luck!

khowe085 commented 1 year ago

That is pretty much how I understood the process was supposed to work based on my knowledge of authentication processes and poking around at the code on github. I id try the xdg-mime command a few times, but I didn't know about the update-mime-database command.

As far as the proton issue, I had realized and corrected the APPID issue, I was overtired and didn't see it lol. I switched the compatibility tool over to proton experimental and that created the expected folder that the script was running.

I think what needs to be fixed here is to have the installer set the compatibility tool to experimental instead of 8.4GE, or keep the humble script in sync w/ whatever the script sets as the on the non-steam game entry.

Thank you for taking the time to explain this process for me!

callit commented 1 year ago

Ok, after reading all of this, I was still having a problem, and like @khowe085 I spent way too much time figuring this out. It seemed like all the pieces were there, but the info was never making it back to the launcher.

In v2.98 There's a bug in your "handle-humble-scheme" script (at least on my Steam Deck): the compatibility data path should read:

export STEAM_COMPAT_DATA_PATH=~/.steam/steam/steamapps/compatdata/NonSteamLaunchers

instead, it reads ~/.steam/steam/Steam/steamapps/compatdata/NonSteamLaunchers

There's an extra Steam in there - looks like that might have been transposed from the .local folder path.

Once I corrected that, launched Humble from within Steam with Proton Experimental, the Auth went through successfully.

moraroy commented 1 year ago

@callit thank you for the pull request i added in your fix, does this now work for you? i still cant seem to get any humble logging in to work for me even after this change. i havnt looked into it enough on my end. sorry about that.

callit commented 1 year ago

Yes, it works for me now. First time I've had any success getting the humble launcher installed and logged-in on the Steam Deck in fact. The authentication flow seems to work as intended. I did a "Start Fresh" a few times while trying to get it to work and I think at one point the Humble scripts didn't appear correctly in the NonSteamLaunchers folder until I reinstalled a second time, but I was bouncing around so much that I don't know if that was my fault or if I missed something.

moraroy commented 1 year ago

@callit good I'm glad. Thank you again for the fix. Hopefully people will be able to use it now. My efforts and concentration have been on the decky plug-in as of late, so I haven't been able to fix some of the launchers.

moraroy commented 1 year ago

@Zoullx @callit we need to figure out a way to allow the sign in in game mode. Does signing in in game mode work for you guys? I've narrowed down the problem on my end is we need to somehow allow the x handle to open up with "steamwebhelper" it seems. I could be wrong though.

callit commented 1 year ago

@Zoullx @callit we need to figure out a way to allow the sign in in game mode. Does signing in in game mode work for you guys? I've narrowed down the problem on my end is we need to somehow allow the x handle to open up with "steamwebhelper" it seems. I could be wrong though.

Unfortunately my level of knowledge deals more with the scripting side of things and a certain knack for pattern recognition. What I've observed is that Game Mode doesn't like/tolerate any sort of popup, but this is only an observation. For example, the way Firefox displays certain alerts or hover menus doesn't seem to work very well which is why I use Brave when I want a browser in game mode.

I suspect this has to do with how each app that's running in game mode seems almost sand-boxed or a reference to one specific window/app. That is, one entry in the running apps menu = one and only one window. It doesn't surprise me that a signin requiring interaction with a browser doesn't work as I also suspect that game mode limits interactions with other apps in some ways.

My other thought is that the URL handler we're using can't be registered with the system or is ignored in game mode. If we think about something like the EA launcher, that might work because it's technically the same executable without relying on a external browser or url handler.

This is all 100% speculation though. I'll give it some thought and take a look around to see if I can find more info on how exactly game mode is handling this sort of thing.

callit commented 1 year ago

@callit good I'm glad. Thank you again for the fix. Hopefully people will be able to use it now. My efforts and concentration have been on the decky plug-in as of late, so I haven't been able to fix some of the launchers.

Off Topic: I love decky BTW - some of the plugins have helped resolve some of my biggest gripes with the deck. The startup/shutdown video randomizer is a fun feature since I have trouble picking just one :).

moraroy commented 1 year ago

@callit yeah decky is really cool, ive already created the decky plugin for NonSteamLaunchers, there is a couple bugs im working on to try and fix before releasing it. this will install the launchers in game mode. which is kinda sorta why i want to fix humble haha...um.... i think we may be able to piggy back on the Shortcut of Humble Bundle actually.. youre able to run a ".sh file along side the launch options in a steam shortcut. so there is that, ALSO.. Steam in Game Mode, will only open as far as i can tell, any url link with its own web browser. Steams Web Browser called "steamwebhelper" is based off of Chromium. So there is some Chrome code that can be utilized there. so here is an example im thinking in the launch options of the Humble Bundle Shortcut, "STEAM_COMPAT_DATA_PATH=\"$HOME/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/\" %command%" ./X-Handlescripthere.sh or instead of that "STEAM_COMPAT_DATA_PATH=\"$HOME/.local/share/Steam/steamapps/compatdata/NonSteamLaunchers/\" %command%" steam://open/url/theurlweneedtoopen? something along those lines? these are just some of my ideas haha

callit commented 1 year ago

I think it's worth a shot, it's a good idea in theory. I don't know the inner workings of Steam well enough to say for sure, but if the .sh file can create the URL handler and Steam's browser is willing to hand off to the registered handler then it just might work.

bunnybreaker commented 8 months ago

Just installed NonSteamLaunchers for the first time and I had the same issue with not being able to log in. My default browser was FireFox though. I downloaded the Flatpak version of Chrome, set it to my default browser, then was able to log into the Humble app without issue.