Vortex: Add option to specify version #810
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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 ifUSEVORTEXCUSTOMVER
is enabled (the checkbox on the UI) andVORTEXCUSTOMVER
has a sane value (is not$NON
and is set). IfgetVortVer
cannot find a valid setup exe, we fall back togetLatestGitHubExeVer
. 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 asdownload
,install
, etc. If we are, we explicitly enableUSEVORTEXCUSTOMVER
(so the above check mentioned will pass) and then setVORTEXCUSTOMVER
to the value passed in. The rest of the logic from here is handled bygetVortVer
, which will take the value ofVORTEXCUSTOMVER
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:
TODO: