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] Selecting an alternative EXE in HBL that contains spaces generates an invalid launcher script due to unquoted parameter. #80

Closed nicktobey closed 2 years ago

nicktobey commented 2 years ago

Describe the bug

To Reproduce (My steps were with Kingdom Hearts 1.5+2.5, but I imagine any game should work, this is just the one that happens to use spaces in the file name and has a legitimate reason for replacing the EXE)

  1. Go to HGL -> KINGDOM HEARTS HD 1.5+2.5 REMIX -> Settings -> Other
  2. Click "Select EXE" and choose "Heroic/KH_1.5_2.5/KINGDOM HEARTS II FINAL MIX.exe" in the file picker
  3. Run HBL's setup.sh
  4. Try to run the produced ./KINGDOMHEARTSHD1525ReMIX_Heroic.sh

Expected behavior The game launces directly into KH2, skipping the initial game select launcher.

Actual behavior Fails to launch with error:

ValueError: Executable path is invalid: /home/deck/Games/Heroic/KH_1.5_2.5/KINGDOM

Details

Additional context The generated launchflatpakgame.sh reveals the cause (I've attached it):

--override-exe /home/deck/Games/Heroic/KH_1.5_2.5/KINGDOM HEARTS II FINAL MIX.exe

Because this parameter is not quoted, bash splits the parameter after KINGDOM. The filename should be quoted so that the whole thing is passed in as a parameter. launchflatpakgame.txt

redromnon commented 2 years ago

Can you please test this workflow build and let me know if it works? Just replace the executable with the existing one and run setup.sh

nicktobey commented 2 years ago

I was able to launch the game with the generated script.