CollapseLauncher / Collapse

An Advanced Launcher for miHoYo/HoYoverse Games
MIT License
1.41k stars 65 forks source link

[Bug]: "Add to Steam" removing user's added non-Steam games #400

Closed BobbyWibowo closed 9 months ago

BobbyWibowo commented 9 months ago

Affected Version

1.73.3 Preview

Bug Behavior

If you had some custom non-Steam shortcuts added to Steam, using Collapse's "Add to Steam" will sometimes get rid of your own custom non-Steam shortcuts.

Expected Behavior

It no do that

Steps to reproduce

  1. Add some non-Steam apps/games
  2. Customize the shortcuts with custom icons/artworks (this step may be necessary to replicate the bug)
  3. Close Steam, then start Collapse
  4. Use "Add to Steam" on any of the games
  5. Close Collapse, then start Steam

Related Issues

No response

Screenshot(s)

Here are my Steam's shortcuts.vdf file before and after using Collapse's "Add to Steam" shortcuts.vdf.zip

Here's the relevant Collapse's log, though I don't see anything of particular interests in it to be honest log-2024-02-12-pre1.73.3-id1.log

Additional Information

Originally reported in a Discussion https://github.com/orgs/CollapseLauncher/discussions/397, moved over here as it's indeed more appropriate

cc @gablm

gablm commented 9 months ago

I seem to have found the problem. Assumed the LastPlayTime field always ended with a \x00, which is not actually the case. (why can't Valve just use a .json file or any well documented file type...)

Would you mind downloading this build and test if it fixes the problem? https://nightly.link/CollapseLauncher/Collapse/actions/runs/7873277772/collapse_x64-Release_net8.0-windows10.0.22621.0_16378a39f42e3f1fbe52b392405bf7840c8c61e4.zip You can unzip it anywhere you like and just need the run the CollapseLauncher.exe executable to start Collapse.

BobbyWibowo commented 9 months ago

@gablm Hi there, just gave that build a spin, unfortunately it still seems to have some issues.

Attached below are 3 different shortcuts.vdf files in separate folders describing their states: shortcuts.vdf.zip

In shortcuts file no. 2, I can "visually" confirm that my custom non-Steam game shortcuts still exist after using that build's "Add to Steam" (as in I can see mentions of the EXE path and such). But after launching Steam, it seems some of those games are not displayed in Steam app's Library (specifically 7zFM.exe and Notepad3.exe, but also the build's own game shortcuts).

I suspect they became malformed and such, because after adding another non-Steam game to Steam, the shortcuts file gets rebuild with all those non-displaying shortcuts being removed, as can be seen in shortcuts file no. 3.

gablm commented 9 months ago

Hello again!

Can you try this build and let me know if you still encounter any issues? https://nightly.link/CollapseLauncher/Collapse/actions/runs/7880824759/collapse_x64-Release_net8.0-windows10.0.22621.0_000b89e1883b36f29674eaa7758097426e8a6bdd.zip

BobbyWibowo commented 9 months ago

@gablm Did quite a bit of testing, with unrelated non-steam shortcuts and categories, and so far I can confirm that build works properly 🎉

Thank you, looking forward to the next official/preview build!