Heroic-Games-Launcher / HeroicGamesLauncher

A games launcher for GOG, Amazon and Epic Games for Linux, Windows and macOS.
https://heroicgameslauncher.com
GNU General Public License v3.0
8.18k stars 430 forks source link

Error when uploading Saves on GOG games #3637

Open GarnetSunset opened 7 months ago

GarnetSunset commented 7 months ago

Describe the bug

Appears to be an issue of escaping, since it's throwing an error around the file directory, guessing it's an issue where the file path isn't escaped correctly. GOGDL specifically.

Add logs

[3/17/2024, 4:34:56 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"auth`"" -NoNewWindow
[3/17/2024, 4:34:56 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"auth`"" -NoNewWindow
[3/17/2024, 4:34:56 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"auth`"" -NoNewWindow
[3/17/2024, 4:34:57 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"auth`"" -NoNewWindow
{"access_token":"<redacted>","expires_in":3600,"token_type":"bearer","scope":"","session_id":"<redacted>","refresh_token":"<redacted>","user_id":"<redacted>","loginTime":1710707698.1411357}
[3/17/2024, 4:34:58 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"info`"","`"gog-redist`"","`"--os`"","`"windows`"" -NoNewWindow
[3/17/2024, 4:34:58 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"auth`"" -NoNewWindow
{"access_token":"<redacted>","expires_in":3600,"token_type":"bearer","scope":"","session_id":"<redacted>","refresh_token":"<redacted>","user_id":"<redacted>","loginTime":1710707698.1411357}
[GENERIC DOWNLOAD_MANAGER] ERROR: Game doesn't support content system api, unable to proceed using platform windows
[3/17/2024, 4:34:59 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"redist`"","`"--ids`"","`"ISI,DirectX,MSVC2017,MSVC2017_x64,MSVC2005`"","`"--path`"","`"C:\Users\James\AppData\Roaming\heroic\tools\redist\gog`"","`"--max-workers`"","`"4`"" -NoNewWindow
[API] INFO: Getting Dependencies repository
[3/17/2024, 4:35:00 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"auth`"" -NoNewWindow
{"access_token":"<redacted>","expires_in":3600,"token_type":"bearer","scope":"","session_id":"<redacted>","refresh_token":"<redacted>","user_id":"<redacted>","loginTime":1710707698.1411357}
(0, 'B') 0
(-122983360, 'B') -122983360
[3/17/2024, 4:35:02 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"--version`"" -NoNewWindow
[3/17/2024, 4:35:02 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"redist`"","`"--ids`"","`"ISI,DirectX,MSVC2017,MSVC2017_x64,MSVC2005`"","`"--path`"","`"C:\Users\James\AppData\Roaming\heroic\tools\redist\gog`"","`"--max-workers`"","`"4`"" -NoNewWindow
[3/17/2024, 4:35:02 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"auth`"" -NoNewWindow
1.0.0
{"access_token":"<redacted>","expires_in":3600,"token_type":"bearer","scope":"","session_id":"<redacted>","refresh_token":"<redacted>","user_id":"<redacted>","loginTime":1710707698.1411357}
[3/17/2024, 4:35:05 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"auth`"" -NoNewWindow
{"access_token":"<redacted>","expires_in":3600,"token_type":"bearer","scope":"","session_id":"<redacted>","refresh_token":"<redacted>","user_id":"<redacted>","loginTime":1710707698.1411357}
[3/18/2024, 1:55:38 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"--version`"" -NoNewWindow
1.0.0
[3/18/2024, 1:55:46 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"--version`"" -NoNewWindow
1.0.0
[3/18/2024, 1:56:01 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"auth`"" -NoNewWindow
[3/18/2024, 1:56:01 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"auth`"" -NoNewWindow
[3/18/2024, 1:56:01 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"auth`"" -NoNewWindow
{"access_token":"<redacted>","expires_in":3600,"token_type":"bearer","scope":"","session_id":"<redacted>","refresh_token":"<redacted>","user_id":"<redacted>","loginTime":1710784562.359411}
[3/18/2024, 1:56:03 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"info`"","`"1083619800`"","`"--os`"","`"windows`"" -NoNewWindow
[3/18/2024, 1:56:03 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"info`"","`"1083619800`"","`"--os`"","`"windows`"" -NoNewWindow
[GENERIC DOWNLOAD_MANAGER] INFO: Depot version: 2
[V2] INFO: Initialized V2 Download Manager
[API] INFO: Getting Dependencies repository
{"size": {"en-US": {"download_size": 35187053546, "disk_size": 36899410958}, "*": {"download_size": 205, "disk_size": 431}}, "dlcs": [], "buildId": "53234214293773307", "languages": ["en-US"], "folder_name": "The Evil Within 2", "dependencies": ["DirectX", "MSVC2017", "MSVC2017_x64"], "versionEtag": "\"3481342392\"", "versionName": "1.04", "available_branches": [null], "builds": {"total_count": 10, "count": 1, "items": [{"build_id": "53234214293773307", "product_id": "1083619800", "os": "windows", "branch": null, "version_name": "1.04", "tags": ["csb_10_6_1_w_134"], "public": true, "date_published": "2020-04-10T07:49:35+0000", "generation": 2, "link": "https://gog-cdn-fastly.gog.com/content-system/v2/meta/c0/a5/c0a57ebf3061d56b94be162fef585510"}], "has_private_branches": true}}
[3/18/2024, 1:56:03 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"auth`"" -NoNewWindow
{"access_token":"<redacted>","expires_in":3600,"token_type":"bearer","scope":"","session_id":"<redacted>","refresh_token":"<redacted>","user_id":"<redacted>","loginTime":1710784562.359411}
[3/18/2024, 1:56:05 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"info`"","`"1083619800`"","`"--os`"","`"windows`"" -NoNewWindow
[GENERIC DOWNLOAD_MANAGER] INFO: Depot version: 2
[V2] INFO: Initialized V2 Download Manager
[API] INFO: Getting Dependencies repository
{"size": {"en-US": {"download_size": 35187053546, "disk_size": 36899410958}, "*": {"download_size": 205, "disk_size": 431}}, "dlcs": [], "buildId": "53234214293773307", "languages": ["en-US"], "folder_name": "The Evil Within 2", "dependencies": ["DirectX", "MSVC2017", "MSVC2017_x64"], "versionEtag": "\"3481342392\"", "versionName": "1.04", "available_branches": [null], "builds": {"total_count": 10, "count": 1, "items": [{"build_id": "53234214293773307", "product_id": "1083619800", "os": "windows", "branch": null, "version_name": "1.04", "tags": ["csb_10_6_1_w_134"], "public": true, "date_published": "2020-04-10T07:49:35+0000", "generation": 2, "link": "https://gog-cdn-fastly.gog.com/content-system/v2/meta/c0/a5/c0a57ebf3061d56b94be162fef585510"}], "has_private_branches": true}}
[3/18/2024, 1:56:12 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"auth`"" -NoNewWindow
{"access_token":"<redacted>","expires_in":3600,"token_type":"bearer","scope":"","session_id":"<redacted>","refresh_token":"<redacted>","user_id":"<redacted>","loginTime":1710784562.359411}
[3/18/2024, 1:56:13 PM] GOGDL_CONFIG_PATH=C:\Users\James\AppData\Roaming\heroic\gogdlConfig powershell Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl`"" -Wait -ArgumentList "`"--auth-config-path`"","`"C:\Users\James\AppData\Roaming\heroic\gog_store\auth.json`"","`"save-sync`"","`""C:\Users\James\Saved Games\TangoGameworks\The Evil Within 2"`"","`"1083619800`"","`"--os`"","`"windows`"","`"--ts`"","`"0`"","`"--name`"","`"saves`"","`"--skip-download`"" -NoNewWindow
Start-Process : A positional parameter cannot be found that accepts argument 'C:\Users\James\Saved'.
At line:1 char:1
+ Start-Process "`"C:\Users\James\AppData\Local\Programs\heroic\resourc ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Start-Process], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand

Steps to reproduce

  1. Click on a GOG game on Windows
  2. Go to Cloud Sync
  3. Hit Upload
  4. Issue

Expected behavior

It should upload the saves.

Screenshots

No response

Heroic Version

Latest Stable

System Information

Additional information

Here's the GOGDL Log:

popgoesme700 commented 7 months ago

This is an issue I get for GOG games on the launcher as well. I think its an issue with how heroic may launch the process, as when I try to upload my cloud save for cyberpunk using heroic, it gives me the following error

Start-Process : A positional parameter cannot be found that accepts argument '%userprofile%\Saved'.

At line:1 char:1

+ Start-Process "`"%localappdata%\Programs\heroic\resources ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidArgument: (:) [Start-Process], ParameterBindingException

    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand

The path for my save game is in %userprofile%\Saved Games\CD Project Red\Cyberpunk 2077 which suggests heroic is not handling spaces in folders/filenames correctly when passing arguments to other processes. Cyberpunk naturally saves games here, but I also have other games I move to this location, and create junctions for in my Documents (that I set the hidden attribute to), as this helps keep my documents folder relatively clean, and full of files I want specifically there. I only bring up this point, as this may cause issues with cloud saves for any other game even if they normally save in Documents, and may be worth checking to ensure all passed arguments to other processes are correctly escaped.

Zorg64 commented 6 months ago

Starting Heroic.exe with Powershell then attempting a save sync, I was able to derive and alter the ps command to work with cyberpunk.

Start-Process -NoNewWindow -Wait -FilePath "$env:USERPROFILE\AppData\Local\Programs\heroic\resources\app.asar.unpacked\build\bin\win32\gogdl.exe" -ArgumentList "--auth-config-path", "`"$env:USERPROFILE\AppData\Roaming\heroic\gog_store\auth.json`"", "save-sync", "`"$env:USERPROFILE\Saved Games\CD Projekt Red\Cyberpunk 2077`"", "1423049311", "--ts", "0", "--os", "windows", "--name", "saves"