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

[Unexpected behaviour] Steam locate try to list game from flatpak steam when it as been uninstalled instead of native steam #17

Open
Yato202010 opened this issue Feb 14, 2023 · 9 comments

Comments

@Yato202010
Copy link

During the development of my app I wanted to add steam flatpak support but steamlocate suddenly stopped working after that test .
It appears that Steamlocate only check if the steam folder is present and not if the steam flatpak is installed which is a big problems in the case of migration from steam flatpak to native steam since it appears that the steam flatpak folder is not deleted upon uninstall.

@CosmicHorrorDev
Copy link
Collaborator

That is a bit of an unfortunate aspect of the current design. I think that my preferred way of handling it would be to move the flatpak logic under a separate constructor (e.g. a locate_flatpak()) instead of the current logic of looking for a flatpak dir and then falling back to looking for the regular system installation

It takes away the "Just works" aspect, but also makes things very clear in how everything works. Any thoughts @WilliamVenner ?

@WilliamVenner
Copy link
Owner

Is there a way be can detect if the Steam flatpak dir is the actual desired output?

@Yato202010
Copy link
Author

Yato202010 commented Feb 16, 2023

why not checking if steam is installed and have a steam folder by checking if /var/lib/flatpak/app/com.valvesoftware.Steam/ and $HOME/.var/app/com.valvesoftware.Steam exist as a simple fix to not break any project depending on this crate and add locate_flatpak() in 2.0 ? since it's unlikely that a user have both flatpak and native steam installed at the same time

@WilliamVenner
Copy link
Owner

Yeah I'm not entirely sure of any use cases for a locate_flatpak() function. Would probably make more sense to just keep it simple unless there's something I'm missing.

Maybe we could do some abhorrent hack that compares the last modified time of each installation and chooses the most recent one if both are present. Cursed

@Yato202010
Copy link
Author

Yato202010 commented Feb 16, 2023

Yeah I'm not sure for the locate_flatpak() either but I don't really see any seamless elegant solution that would fit in locate() but yeah comparing the 'age' of folder could work

@Gawdl3y
Copy link

Gawdl3y commented Dec 19, 2023

Could you not potentially check with Flatpak on whether the Steam installation is still active or not? flatpak info com.valvesoftware.Steam will yield a successful response if it's installed.

@LuisMayo
Copy link

Hi

I've been recently checking this since my app uses this library and my users have complained about this error.

Aside from the error though, I've been further investigating this issue and as far as I think there is no reason why Linux users couldn't have both flatpak and native versions of Linux installed which certainly adds to the problem.

That's why I think than ideally in some capacity the library should be supporting this by returning an iterator/Array of all SteamDirs instead of just one. Specially relevant given than 2.0 is around the corner and API changes can still be discussed. Or at leas under a different method

Thanks!

@CosmicHorrorDev
Copy link
Collaborator

I agree that someone can have multiple valid steam installations (although I'd imagine that's exceedingly rare)

Considering it would be such a niche case I don't think it should have any impact on the existing API. It'd probably be offered through something like SteamDir::locate_many()

@LuisMayo
Copy link

Understandable, I'll work on it against the v2 branch

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

No branches or pull requests

5 participants