Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

More reliable Proton installation discovery #21

Merged
merged 3 commits into from
Oct 5, 2018

Conversation

Matoking
Copy link
Contributor

@Matoking Matoking commented Sep 28, 2018

Fixes #17

  • Find Steam's active Proton installation from ~/.steam/steam/config/config.vdf (or the corresponding Steam install path) and use it instead of the first Proton installation we find if $PROTON_VERSION isn't set.
    • As with library folders, this uses a rough regex to find the installed Proton version. We could use the vdf package on PyPi, but in the interest of keeping this script self-contained, I use a regex instead. Still, something to keep in mind if this script continues to grow.
    • Finding the active Proton version is a bit hacky; if the config.vdf has a certain entry name with the value "proton_37_beta", we translate that to the app name "Proton 3.7 Beta" which we use to find the installation directory which has that exact name. "proton_316_beta" on the other hand would be translated as "Proton 3.16 Beta", which I'd assume to be the next Proton version if they rebase it on Wine 3.16. "proton_102_beta" would break if the actual version is "Proton 10.2 Beta" and not "Proton 1.02 Beta", but I'm pretty sure Wine won't reach major feature version 10 any time soon, and Proton won't deviate from using Wine versioning.
  • Also look for Proton installation in any of the Steam library folders, just as we do with games. It isn't always installed under ~/.steam.

@Matoking Matoking force-pushed the find_proton branch 2 times, most recently from c13289b to 7a0e9af Compare September 28, 2018 21:36
@Sirmentio
Copy link
Owner

I'm finally glad someone has gotten to this, I wouldn't have known one could look in .vdf files, and I'll be happy to merge this, hopefully in the future someone may make a less hacky method, but it works!

@Sirmentio Sirmentio merged commit 5703f3c into Sirmentio:master Oct 5, 2018
@Danielhlane
Copy link
Contributor

I had a dig around those vdf files myself.

The amount of grepping I did was crazy. I did think about making an improvement similar to yours (version parsing from vdf, like you've done here in the get current proton version function) but worried about the way valve present the versioning.

With that said though, surely steam stores the path to proton somewhere in its config? I think that'd be the next logical step to nailing down proton detection 100%, I couldn't find it by grepping steam dirs or libraries though.

Anyway, good work on this PR, definitely better than my hacky mess!

@Matoking Matoking deleted the find_proton branch January 25, 2019 12:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants