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

Vortex: Add option to specify version #810

Merged
merged 4 commits into from
May 25, 2023
Merged

Vortex: Add option to specify version #810

merged 4 commits into from
May 25, 2023

Conversation

sonic2kk
Copy link
Owner

@sonic2kk sonic2kk commented May 23, 2023

Partially implements #809.

Overview

This PR adds an option to specify a Vortex version to download, either from the commandline with something like steamtinkerlaunch vortex start v1.7.0, or from the GUI by enabling the option in the Global Menu and selecting a valid version. On the UI, the default version is "none" ($NON) which we account for and flag as an invalid value, so we fall back to the latest (either stable or beta, depending on what the user has selected).

If the user passes an invalid value, we fall back to getting the latest version, which as above can be either the latest stable or the latest beta depending on what the user has selected.

Implementation

Example usage:

# Will just start Vortex normally with one of the following:
# latest stable, latest pre-release (if enabled), custom Vortex version (if set from Global Menu)
steamtinkerlaunch vortex start

# Will use the version passed here **regardless of menu preference**
steamtinkerlaunch vortex start v1.7.0

The logic in getLatestGitHubExeVer is just fetching the latest GitHub tag, and then feeding that in to build a URL for the download URL for that tag. Since this URL could be any (valid) tag, this part was split out into a separate function, getGitHubExeVer, that builds a URL based on a given tag. getLatestGitHubExeVer then passes its tag to this function.

When we pass a tag to Vortex to get, we pass our tag to getGitHubExeVer directly via a new function, getVortVer, which gets called if USEVORTEXCUSTOMVER is enabled (the checkbox on the UI) and VORTEXCUSTOMVER has a sane value (is not $NON and is set). If getVortVer cannot find a valid setup exe, we fall back to getLatestGitHubExeVer. The tag value can be set from the Vortex options on the Global Menu.

From the commandline, we check if we're passing any $2 argument to Vortex that could potentially start Vortex, such as download, install, etc. If we are, we explicitly enable USEVORTEXCUSTOMVER (so the above check mentioned will pass) and then set VORTEXCUSTOMVER to the value passed in. The rest of the logic from here is handled by getVortVer, which will take the value of VORTEXCUSTOMVER as if it were passed from the UI.

Related Work

#809 mentions passing a custom executable from the commandline. This would be a good idea imo as well, but will go in a separate PR.

Also, an option from the commandline to set no automatic Vortex updates would be useful imo as related work to this, but would also go in a separate PR and would only apply to the start command with something like steamtinkerlaunch vortex start --no-auto-updates. This flag would be permanent and could apply across updates. Applying this would set the preference in Vortex as well as in STL, which is something to be considered (we need to store it in the global config so the checkbox on the UI reflects the setting).

Caveats

There are a few implementation caveats which were designed this way explicitly:

  • Vortex versions passed from the commandline will always override any preference for a given version, as well as overriding the preference to do this at all. In other words, if a version tag is passed from the commandline, we will always attempt to use this
  • This will not reinstall Vortex. To change Vortex version, the user is expected to re-install. I don't think there's any way for us to do this without implementing some kind of prefix removal, and users could lose data this way, so it is up to the user to understand the risks of meddling with Wine prefixes.
  • If users are installing a Vortex version older than the latest stable, they should enable the option on the Global Menu to disable automatic Vortex updates. This will not be disabled automatically.

TODO:

  • Some further testing (ideally from OP of linked issue)
  • Update help screen
  • Update wiki
  • Update langfiles

@sonic2kk
Copy link
Owner Author

OP in #809 confirmed that this worked, noting that Winetricks needed for be updated beforehand with sudo winetricks --self-update. This will be noted on the wiki also.

@sonic2kk
Copy link
Owner Author

Updated help screen and langfiles. Will do one more test pass, then update the wiki and merge.

@sonic2kk
Copy link
Owner Author

Wiki has been updated.

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.

1 participant