redromnon / HeroicBashLauncher

Directly launch any Epic Games Store and GOG game from anywhere without Heroic on Linux.
GNU General Public License v3.0
354 stars 17 forks source link

Support symlinks #111

Closed konsumer closed 1 year ago

konsumer commented 1 year ago

Is your feature request related to a problem? Please describe.

I have my games symlinked to sdcard, which works fine in Heroic Games Launcher, but not the launchers made with this.

ls -al ~/Games/
total 8
drwxr-xr-x  2 deck deck 4096 Oct 30 18:58 .
drwx------ 19 deck deck 4096 Oct 30 19:01 ..
lrwxrwxrwx  1 deck deck   28 Oct 30 18:58 Heroic -> /run/media/mmcblk0p1/Heroic/

Describe the solution you'd like

I'd like if the scripts accepted the resolved ~/Games/Heroic/ as the correct dir.

Describe alternatives you've considered

Maybe some sort of setting that let me point to the correct dir.

Additional context

I'm going to work on a PR for it, if anyone else is interested (otherwise it's what I will use for myself.)

redromnon commented 1 year ago

Sure, please go ahead with the PR. This will be beneficial for many users.

konsumer commented 1 year ago

Seems like main prob is here. Not sure of best way to solve it.

I could do a test more like this:

if (os.path.exists(os.path.expanduser('~/Games/Heroic/'))):

instead of:

if("Games/Heroic/" in os.getcwd()):

It's a bit hard to test, though, as the installed version is a binary (not python.) Are there any tricks for testing it?

konsumer commented 1 year ago

Also it's started in ~/Games/Heroic/HeroicBashLauncher/GameFiles/, so it seems like this would always return false, right?

Maybe I am misunderstanding some key part.

redromnon commented 1 year ago

Basically, the HeroicBashLauncher folder should always be present in ~/Games/Heroic due to permission issues related to Heroic, especially if you're using Heroic as a Flatpak.

Thus the following code

if("Games/Heroic/" in os.getcwd()):

checks if the HeroicBashLauncher and naturally, the binary, are placed in ~/Games/Heroic Otherwise, users will face issues if they place the folder anywhere else.

Hope this makes it clear. Maybe I should add a comment to the code.

redromnon commented 1 year ago

Also it's started in ~/Games/Heroic/HeroicBashLauncher/GameFiles/, so it seems like this would always return false, right?

Yes, GameFiles is only reserved for the bash/launch files generated by the program. The program/binary should always be placed in the root HeroicBashLauncher folder. It's not neat but it is what it is.

konsumer commented 1 year ago

Ah, ok, so I will do this sort of test, maybe:

if (os.path.exists(os.path.expanduser('~/Games/Heroic/HeroicBashLauncher'))):

I will probly need to adjust a few other paths to follow the expanduser pattern.

I am testing over ssh on my steamdeck and building on another linux box. I think I need to just run it directly on a linux box, this is a bit hard to test.

redromnon commented 1 year ago

By the way, you can also use the --silent argument to disable GUI popups for faster testing.

konsumer commented 1 year ago

I think I have the fix in place, but can't seem to build a working HeroicBashLauncher, in linux docker or on real steamdeck. when I run it, it says modules that are installed (requests, wget) are not available. I will just PR, and you can test it, and if it works I will use the release.

redromnon commented 1 year ago

Yeah, you will need pyinstaller and the necessary dependencies to be installed for building the executable. The build.sh file runs pyinstaller.

I need to add a requirements.txt file for convenience.

Anyway, do check your PR for some additional context.

konsumer commented 1 year ago

I have pyinstaller. it seems like the built runtime is not setup right, like it requests modules that are definitely installed on both devices (my desktop and the actual steamdeck.) I noticed today that Hero Launcher now has an "add to steam" feature, which seems to work great, so i will just use that.

redromnon commented 1 year ago

The "Add to Steam" has been there since HGL v2.4.0 I think. I would personally recommend using it if you're a heavy Steam user or use a Deck.

Bash Launcher serves a wider audience looking to integrate Heroic into other game launchers other than Steam.

konsumer commented 1 year ago

That makes sense! I didn't see it before, which is what got me on this path, but it seems to work pretty well. Thanks for your help!