Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable using a symlinked "Public" user folder along with "steamuser" with the same behavior. #883

Merged

Conversation

diegoortizmatajira
Copy link
Contributor

Need for this change

A central copy for my "steamuser" and "Public" user folders allowed me to make backups for my game progress when using multiple proton prefixes. Public folder is used sometimes for some game versions to store data.

I found that I can manage that feature using:

## symlink the steamuser directory
USESUSYM="1"
## symlink the steamuser directory globally to one directory
USEGLOBSUSYM="1"

But that option only symlinks my "steamuser" folder, so I have added the code also to symlink "Public" user folder.

Proposed change

With the code I have added, source folders are located in:

$HOME/.config/steamtinkerlaunch/proton/steamuser
$HOME/.config/steamtinkerlaunch/proton/Public

and both of them can contain a global or multiple $AID subfolders as required.

Symlinks are created on game prefix inside pfx/drive_c/users folder.

Doing so will ensure that both folders are symlinked per game or globally with the same behavior as steamuser.

diegoortizmatajira and others added 3 commits August 23, 2023 11:33
It adds the Public user folder to created/backed up/restored linked folders for a game prefix. To keep all settings in a single place.
@sonic2kk
Copy link
Owner

Thanks for opening a PR! This feature sounds very useful, essentially allowing for the Public folder in pfx/drive_c/users to be shared amongst other prefixes, just like how the steamuser symlink works. Awesome work! :-)

The implementation also looks sound to me, it mostly follows what the steamuser symlink does. I am wondering if it might be a good idea in future to create a "shared" function that can manage creating symlinks. Though this can always be tackled later on, it's not like this is followed very well in the rest of the codebase 😅

Having a separate method could make it easier to redirect other folders, though there's a point where that might start to overlap too much with redirect compatdata, so it's really not that big of a deal. Plus touching too much of the existing SteamUser symlink stuff could be a bit of a delicate operation.

The explanation for this sounds logical, I can see why this would be desirable. Just wondering, could there be a (reasonable) case where a user may want to symlink the steamuser directory but not symlink the Public directory? Could there be a case where this could be problematic? If so, with the way this is implemented, it would be straightforward to gate this behind a separate checkbox (which could be on by default). But that might not be necessary, please let me know if you think having the ability to toggle this behaviour is warranted.


Overall this looks really good! Just that outstanding question over whether this could pose a problem. If you don't think it will or are at least reasonably confident in it, I'm happy to merge this as-is and deal with complaints like that down the road (it should be a straightforward change if it's ever needed).

Thanks again for all your work on this!

@diegoortizmatajira
Copy link
Contributor Author

Hi, in regards your question:

The explanation for this sounds logical, I can see why this would be desirable. Just wondering, could there be a (reasonable) case where a user may want to symlink the steamuser directory but not symlink the Public directory? Could there be a case where this could be problematic? If so, with the way this is implemented, it would be straightforward to gate this behind a separate checkbox (which could be on by default). But that might not be necessary, please let me know if you think having the ability to toggle this behaviour is warranted.

For most games, it boils down to storing data inside steamuser OR Public but for reduced tinkering, I usually link both folders in game prefixes, and let the game use whatever it wants to.

Also, I had to take time to experiment a little before finding this option in Steamthinkerlaunch, as it wasn't entirely clear to me from the Wiki article, I had to track down the code to fully understand how it works.

Being so, splitting this into two options in settings (for steamuser and `PublicN individually) may be even harder to understand for someone new. We can keep them together, and work on it if someone needs it.

If I get the chance, I'll try to add more detailed documentation to Wiki.

@sonic2kk
Copy link
Owner

Also, I had to take time to experiment a little before finding this option in Steamthinkerlaunch, as it wasn't entirely clear to me from the Wiki article, I had to track down the code to fully understand how it works.

There's lots of room for improvement on the wiki :-) If you look at the page edit history it's probably pretty sparse and/or pretty old. I even had to look up the code for this to understand how this feature fit together (I didn't write the steamuser symlink stuff, I think the previous maintainer did).

This is ideal too imo, since because I didn't write this code, improvements coming from someone who uses this feature and understands how to improve it will always be more useful! 😄

If symlinking both folders results in less tinkering and if you haven't experienced any issues linking both, then I'm happy with that!


For wiki updates, I think GitHub has relatively poor collaboration for wikis. If there's a way for you to "open a PR" so to speak for a wiki improvement that would be awesome, but if GitHub doesn't facilitate this, feel free to submit a markdown document or something along those lines to #457, but there is no pressure to contribute there :-)

@diegoortizmatajira
Copy link
Contributor Author

I had this proposed change applied on steamthinkerlaunch v12.12 on my machine and it works properly, The only issue happens with Borderlands series and Tiny Tina Wonderlands displaying:

"Your Settings Have Failed to save. Would You Like to Try Saving Again?"

Then, I had to stop using symbolic links with them. But every other game so far works properly. Anyways is a game issue, not related with steamthinkerlaunch.

Now, It is up to you to merge the change.

@sonic2kk sonic2kk merged commit 5975200 into sonic2kk:master Aug 23, 2023
@sonic2kk
Copy link
Owner

Thanks a bunch for your contribution to SteamTinkerLaunch, I have updated the changelog to include this change under the "Features" section: https://github.com/sonic2kk/steamtinkerlaunch/wiki/Changelog

I think others find this feature useful as well :-)

@diegoortizmatajira diegoortizmatajira deleted the feature/public-user-folder-symlink branch August 23, 2023 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants