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] GOG games (library.json not found/empty) #126

Open tegaidogun opened 1 year ago

tegaidogun commented 1 year ago

Describe the bug Gets an unhandled exception whenever I try running the application on my Steam Deck sing the latest version currently being 3.2.1.

To Reproduce Steps to reproduce the behavior:

  1. Right-clik the main executable and "Run In Konsole" on a Steam Deck.
  2. Get an unhandled exception stating that library.json doesn't exist in the heroic games launcher.

Expected behavior I have met this error before, and I expected that playing the game at least once undoes this error but sadly, it didn't

Details

redromnon commented 1 year ago

Could you please paste the full log here? The error you see on the terminal.

redromnon commented 1 year ago

Maybe it's checking library.json in the wrong path.

tegaidogun commented 1 year ago

This is what is in HeroicBashLauncher.log:

[INFO] Using Bash Launcher v3.2.1
NOTE - This is an independent project and not affiliated with Heroic Games Launcher.

[DEBUG] Starting new HTTPS connection (1): api.github.com:443
[DEBUG] https://api.github.com:443 "GET /repos/redromnon/HeroicBashLauncher/releases/latest HTTP/1.1" 200 1432
[INFO] Done! Now creating launch files for your Epic Games library ...

Although when I run the executable in a terminal, I get this:

Using Bash Launcher v3.2.1
NOTE - This is an independent project and not affiliated with Heroic Games Launcher.

3.32.0
Traceback (most recent call last):
  File "func/HeroicBashLauncher.py", line 69, in <module>
  File "func/listinstalled.py", line 65, in listinstalled
FileNotFoundError: [Errno 2] No such file or directory: '/home/deck/.var/app/com.heroicgameslauncher.hgl/config/heroic/gog_store/library.json'
[223096] Failed to execute script 'HeroicBashLauncher' due to unhandled exception!
redromnon commented 1 year ago

I can encounter this issue. Maybe this issue is occurring due to Heroic'd latest stable v2.7.0. I didn't encounter this before. My library.json is present but empty. This is where data related to all GOG games in the account is supposed to be stored.

For now, you can turn off GOG games check in settings.config (present next to the HeroicBashLauncher executable) by setting gog: false

redromnon commented 1 year ago

Or you can just use Heroic's built-in Add To Steam feature. It's more polished.

redromnon commented 1 year ago

Found the solution: there's a new store-cache directory which Heroic now presumably uses. This issue will be fixed in the next release.

tegaidogun commented 1 year ago

Thanks for everything!

tegaidogun commented 1 year ago

I actually got another issue with library.json in another directory which affects the games from the Epic Games Store too. This is my log:

[INFO] Using Bash Launcher v3.2.1
NOTE - This is an independent project and not affiliated with Heroic Games Launcher.

[DEBUG] Starting new HTTPS connection (1): api.github.com:443
[DEBUG] https://api.github.com:443 "GET /repos/redromnon/HeroicBashLauncher/releases/latest HTTP/1.1" 200 1551
[INFO] Done! Now creating launch files for your Epic Games library ...
[INFO] Sonic Mania [818447bb519b46d48d365d5753362796]...
[WARNING] shortcuts.vdf already exists in 1082050489
[INFO] Adding Sonic Mania to Steam
[INFO] Steam AppID for Sonic Mania is 2493287133
[INFO] Checking Artwork...
[CRITICAL] Traceback (most recent call last):
  File "func/artwork.py", line 72, in addartwork
FileNotFoundError: [Errno 2] No such file or directory: '/home/deck/.var/app/com.heroicgameslauncher.hgl/config/heroic/lib-cache/library.json'

[CRITICAL] Traceback (most recent call last):
  File "func/artwork.py", line 72, in addartwork
FileNotFoundError: [Errno 2] No such file or directory: '/home/deck/.var/app/com.heroicgameslauncher.hgl/config/heroic/lib-cache/library.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "func/steam.py", line 175, in addtosteam
  File "func/artwork.py", line 172, in addartwork
AttributeError: 'Namespace' object has no attribute 'silent'
redromnon commented 1 year ago

Noted. I'll won't be able to fix this anytime soon. I'll close this myself whenever I push the fix.

redromnon commented 1 year ago

Hey, can you please check if the following build works? https://github.com/redromnon/HeroicBashLauncher/actions/runs/4796826991

tegaidogun commented 1 year ago

It went well on the first run then couldnt overwrite the new file for some reason.

[INFO] Using Bash Launcher v3.2.2
NOTE - This is an independent project and not affiliated with Heroic Games Launcher.

[DEBUG] Starting new HTTPS connection (1): api.github.com:443
[DEBUG] https://api.github.com:443 "GET /repos/redromnon/HeroicBashLauncher/releases/latest HTTP/1.1" 200 1417
[INFO] Done! Now creating launch files for your Epic Games library ...
[INFO] Sonic Mania [818447bb519b46d48d365d5753362796]...
[WARNING] shortcuts.vdf already exists in 1082050489
[CRITICAL] Traceback (most recent call last):
  File "func/steam.py", line 131, in addtosteam
  File "func/steam.py", line 75, in calculate_last_srno
ValueError: invalid literal for int() with base 10: 'ck"'
redromnon commented 1 year ago

I haven't conducted a lot of tests for the add-to-steam functionality. I'm thinking of either refactoring it entirely or just removing this feature since Heroic already has a better implementation of this.

As a workaround, just set autoaddtosteam to False in settings.config You'll have to add any new games to Steam manually though.