tylerbrawl / Galaxy-Plugin-Rockstar

MIT License
71 stars 7 forks source link

No action on clicking play, possibly wrong path #65

Open FriendsOfGalaxy opened 4 years ago

FriendsOfGalaxy commented 4 years ago

Hey, using version 0.4 i have Max Payne 3 installed which is correctly detected by the plugin. image However when i click on Play nothing will happen and i can see the following error in the logs:

2019-12-16 09:45:18,095 - galaxy.api.jsonrpc - INFO - Handling notification: method=launch_game, params={'game_id': '10'}
2019-12-16 09:45:18,095 - galaxy.task_manager - DEBUG - Task manager jsonrpc server: creating task 18 (launch_game)
2019-12-16 09:45:18,095 - galaxy.task_manager - DEBUG - Task manager plugin external: creating task 25 (launch_game)
2019-12-16 09:45:18,095 - root - DEBUG - ROCKSTAR_INSTALLER_PATH: ***
2019-12-16 09:45:18,095 - root - DEBUG - ROCKSTAR_LAUNCH_REQUEST: Requesting to launch D:\Program Files\Rockstar Games\Max Payne 3 Complete Edition,0\MaxPayne3.exe...
2019-12-16 09:45:18,096 - galaxy.task_manager - ERROR - Task manager jsonrpc server: exception raised in task 18 (launch_game)
Traceback (most recent call last):
  File "C:\Users\Mateusz\AppData\Local\GOG.com\Galaxy\plugins\installed\Rockstar\galaxy\task_manager.py", line 21, in task_wrapper
    result = await coro
  File "C:\Users\Mateusz\AppData\Local\GOG.com\Galaxy\plugins\installed\Rockstar\galaxy\api\plugin.py", line 295, in wrapper
    return await self._external_task_manager.create_task(handler(*args, **kwargs), name, False)
  File "C:\Users\Mateusz\AppData\Local\GOG.com\Galaxy\plugins\installed\Rockstar\galaxy\task_manager.py", line 21, in task_wrapper
    result = await coro
  File "C:\Users\Mateusz\AppData\Local\GOG.com\Galaxy\plugins\installed\Rockstar\plugin.py", line 676, in launch_game
    game_pid = await self._local_client.launch_game_from_title_id(title_id)
  File "C:\Users\Mateusz\AppData\Local\GOG.com\Galaxy\plugins\installed\Rockstar\local.py", line 77, in launch_game_from_title_id
    stderr=subprocess.DEVNULL, shell=False)
  File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\subprocess.py", line 775, in __init__
  File "D:\obj\Windows-Release\37win32_Release\msi_python\zip_win32\subprocess.py", line 1178, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified

i think the issue lies in attempting to use incorrect path Requesting to launch D:\Program Files\Rockstar Games\Max Payne 3 Complete Edition,0\MaxPayne3.exe. the ',0' part

This is how my registry entry for the game looks image

FriendsOfGalaxy commented 4 years ago

Same issue occurs for GTA5: Requesting to launch D:\Program Files\Rockstar Games\Grand Theft Auto V,0\GTA5.exe

FriendsOfGalaxy commented 4 years ago

After updating rockstar launcher the path in registry changed to image It looks like the issue will only occur for some versions of the client, up to you if you want to have a fallback for this.

tylerbrawl commented 4 years ago

This seems to be a problem with outdated launcher clients. I have implemented a check to replace any instance of ,0 in the key with a blank string.

FriendsOfGalaxy commented 4 years ago

,0 may be used inside path theoretically. But if Rockstar is goining to remove this in newer updates, i thinks its ok

tylerbrawl commented 4 years ago

I remember my InstallLocation registry key being changed to the new format months ago, so I was surprised to see that the old format was still being used. I did add a check to replace that for anybody that still has the old key format (the one with the ,0), but I am unsure of how long this will be needed for.