-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: allow returning multiple directories #64
base: master
Are you sure you want to change the base?
Conversation
Just wanted to let you know that I'm also waiting for this feature :) My use case is that I want to find a particular game, regardless of in which installation it's installed. I looked at the code and wondered, is it really an error if no installations are found? I figure it could just return an empty Vec in that case. |
That's actually the very same reason I want it. My app patches a Videogame (VHS) and I want to locate it to patch the exe, no matter the install dir About returning on Error I just made it to be consistent with the |
The implementation is based on WilliamVenner#64, with some code changes around Vec and Iterator handling.
I would love to have this merged. I'm building a project and would like to account for edge cases where people may have both Flatpak and Native Steam installed and I want to let them pick which installation to work with. I will just use your fork for now. Thank you! |
I see the branch is now conflicting with main. If I get any signal this is wanted I will rebase! And you can use the fork of course. I've been doing that and it works for me |
Unfortunately I wasn't able to use it in my case because it returned multiple entries for each installation, as per these lines: Lines 74 to 86 in f69067b
In my experience the IMO, only a crazy person would have multiple installations of Steam on the same machine, but I can't count on other people to not be crazy, so I'm still very interested in this PR. This crate has been an absolute lifesaver and other than this very minor limitation, it's perfect. |
Sorry for the (very long) delay. I'm finally getting around to taking a look at this and in general I like the idea of providing an API for locating all steam installations. One caveat though; I would also really like to be able to detect when a steam installation is still actually valid (ref #17). Most of the time it seems like people have multiple installations from installing and uninstalling in different ways that leave lingering files that we pick up as a steam installation. I'd prefer if we could filter out no-longer-valid installations in some way Re @amtep
I would agree. Returning an empty vec when trying to locate all installations seems reasonable to me Re @dotaxis
I can confirm the same on my installation. Both Also thanks for all the kind words! It's been a lot of effort trying to juggle all of the projects I try to maintain, but knowing that other people get use out of them makes all the work worth it :) |
I can't find any documentation on what the different symlinks are meant to point to but I think it is safe to remove But perhaps a better approach would be to actually follow the symlinks and then form a vector of install directories based on where they point to. That would avoid duplicates without just guessing at which symlinks are important. |
That seems like it might be the most robust approach. It should just involve a little |
@LuisMayo do you have any interest in implementing this using read_link to avoid dupes? |
I will implement Link following as well as other of the suggestions here (like empty Vec) I'm gonna have a really busy week so it may take a while even those two little changes |
Just ping me whenever your changes are ready. Now that v2 is released I'm much more available for review :) |
Hi Changes pushed @CosmicHorrorDev Please someone check if Windows side of things is working fine since I haven't had the time to do it Thanks! |
Clippy will probably be angry, but that's what CI is for after all 😸 |
I think clippy should be happy now |
|
Ok more changes now. Let's see if it works |
Also another quick tip: I think you can enable action runs on your fork to get a bit of a faster feedback loop |
Finally. Sorry for the trouble |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few nits, but overall the implementation is looking pretty good now 🚀
No worries at all! I'm just happy to have help :D |
Suggestions applied! Thanks a lot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went ahead and pushed a commit that switches things back to maintaining the original order that dirs get returned in while deduping with a BTreeSet
instead of sorting and deduping, so that way we keep the same order that things are returned in as main
(aka makes me comfortable releasing this without having to consider it a breaking change)
@LuisMayo It looks like there are some merge conflicts. I can handle them if you don't want to deal with them, but I can also leave it to you of course |
I can deal with them but I won't be able to in the following days!
Thanks for the commit preserving the ordering btw.
Enviado desde Outlook para Android<https://aka.ms/AAb9ysg>
…________________________________
From: CosmicHorror ***@***.***>
Sent: Sunday, February 23, 2025 10:34:15 PM
To: WilliamVenner/steamlocate-rs ***@***.***>
Cc: Luis Mayo Valbuena ***@***.***>; Mention ***@***.***>
Subject: Re: [WilliamVenner/steamlocate-rs] feat: allow returning multiple directories (PR #64)
@LuisMayo<https://github.com/LuisMayo> It looks like there are some merge conflicts. I can handle them if you don't want to deal with them, but I can also leave it to you of course
—
Reply to this email directly, view it on GitHub<#64 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AE2K4BFJIUDJBFZ2FTC5NOL2RI5FPAVCNFSM6AAAAABWZS3TOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZXGEZDQNZYGM>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
[CosmicHorrorDev]CosmicHorrorDev left a comment (WilliamVenner/steamlocate-rs#64)<#64 (comment)>
@LuisMayo<https://github.com/LuisMayo> It looks like there are some merge conflicts. I can handle them if you don't want to deal with them, but I can also leave it to you of course
—
Reply to this email directly, view it on GitHub<#64 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AE2K4BFJIUDJBFZ2FTC5NOL2RI5FPAVCNFSM6AAAAABWZS3TOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZXGEZDQNZYGM>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
e427e80
to
237a832
Compare
This PR adds the ability for the library to locate many valid installations, which may be useful, specially on Linux installations. As discussed here: #17 (comment)
I'm really a newbie when it comes to Rust so I'd be happy to fix any problems you may encounter and thanks for your work!