redromnon / HeroicBashLauncher

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

[Bug] Install script exits saying that it isn't in `~/Games/Heroic` when it is. #90

Closed javalsai closed 2 years ago

javalsai commented 2 years ago

I've read the Issues section in the Readme and the Flatpak/Steam-Deck guide.

Describe the bug Install script exits saying that it isn't in ~/Games/Heroic when it is.

To Reproduce (First Screenshot)

Expected behavior Begin installation

Screenshots image image

Details

Additional context I have my heroic directory placed in /opt/games/heroic/javalsai, but I tried two things:

Both failed with the same error (in the screenshot I tried symlink method).

redromnon commented 2 years ago

Strange. HBL checks if the Games/Heroic/ path exists in the current directory (basically /home/username/Games/Heroic/HeroicBashLauncher) before proceeding and your case satisfies the condition.

redromnon commented 2 years ago

Can you directly click/run the HeroicBashLauncher executable via GUI?

javalsai commented 2 years ago

Thanks for the reply!!!

Can you directly click/run the HeroicBashLauncher executable via GUI?

It just fails showing a window with the second screenshot.

javalsai commented 2 years ago

I tried with the version 2.7.5 and it tells me that there is a newer version, that should mean that there passed the directory check, right???

redromnon commented 2 years ago

Yes, because there was no directory check implemented in that release.

javalsai commented 2 years ago

I found the problem. In this line: https://github.com/redromnon/HeroicBashLauncher/blob/1a923c99c0aa30a020b299c4a91bef8942003611/func/HeroicBashLauncher.py#L18 os.getcwd() doesn't return the user home directory, instead it returns the current directory, which in my case is ~/Games/Heroic/HeroicBashLauncher, this can be seen very easily in a python repl: image

redromnon commented 2 years ago

Ah, that's because you have created a symlink if I'm not wrong.

javalsai commented 2 years ago

I think that it should be replaced with os.path.expanduser('~')

redromnon commented 2 years ago

Here's mine Screenshot from 2022-07-17 16-51-37

redromnon commented 2 years ago

I think that it should be replaced with os.path.expanduser('~')

It returns /home/username. It should be part of os.getcwd() path for HBL to work.

javalsai commented 2 years ago

Here's mine Screenshot from 2022-07-17 16-51-37

The script checks if there is a directory called Games/Heroic placed in os.getcwd (in your case it would be /home/redromnon/Games/Heroic/HeroicBashLauncher), but because /home/redromnon/Games/Heroic/HeroicBashLauncher/Games/Heroic does not exist it should fail

redromnon commented 2 years ago

Yes, the second path does not and should not exist.

redromnon commented 2 years ago

Since in my case os.getcwd returns /home/redromnon/Games/Heroic/HeroicBashLauncher, HBL checks if /Games/Heroic/ is present in that path, which it is. It does not append the path like /home/redromnon/Games/Heroic/HeroicBashLauncher/Games/Heroic

redromnon commented 2 years ago

I think that symlink is causing the issue.

javalsai commented 2 years ago

I think that symlink is causing the issue.

Probably, maybe this fixes it: image

redromnon commented 2 years ago

That is correct. os.path.isdir() just checks if that dir is present. But the catch is, your current path [os.getcwd()] should match it when you are executing HBL. But instead, it's being redirected to /opt/games/heroic/javalsai/HeroicBashLauncher because of that symlink. This should not happen.

javalsai commented 2 years ago

If you tell me how to compile the project I can try it

redromnon commented 2 years ago

You can follow this - https://github.com/redromnon/HeroicBashLauncher#building-and-testing and change the dir check code accordingly to support your symlink. Or erase it if you wish to.