Repository navigation
fix(installer): stop using the Vintage Story installed on the machine in the legacy scripts - #718
Merged
Merged
Conversation
… in the legacy scripts scripts/install-windows.ps1 required a Vintage Story install, linked it (or copied it) into the build folder and packaged from it. scripts/install-macos.sh copied the installed game into the Optimum folder. Both took whatever was on the machine as the source, so a modified, outdated or already patched game ended up in the result. install-windows.ps1 now lets bootstrap.ps1 download, verify and extract the official client into the build folder, and packages from that extraction. The archive is kept in the source tree's .vanilla\archives, which the build copy leaves out, so it is downloaded once and not for every install. The installed game is only looked up, best effort, to keep the install and data folders away from it. The wizard no longer requires, browses for or checks the version of an installed game, and the version is no longer picked from it. The dead state and the version helpers that only served that are gone, and the -Version help says that a version without pins is not verified. install-macos.sh keeps --uninstall, which removes an install that an older version of the script made, and refuses to install with a message that points to the Optimum installer or the .dmg build. The README says that the client is always downloaded and verified and that an installed copy is never a source.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Two legacy scripts took the Vintage Story installed on the machine as their source:
scripts/install-windows.ps1required an installed game, linked it (or copied it with robocopy) to.vanilla\win-x64\vintagestoryin the build folder, ranbootstrap.ps1 -ClientArchive __skip__and packaged with-VanillaDir $VsPath.scripts/install-macos.shcopied the installed game into the Optimum folder.A modified, outdated or already patched game therefore ended up in the result. The installer, the bootstrap scripts and the launcher now verify the client against the pins in
forks.json(#716 and #717), so these two scripts should not bypass that.Change
install-windows.ps1letsbootstrap.ps1download, verify and extract the official client into the build folder and packages from that extraction (-VanillaDir $vanillaDir). The archive is kept in the source tree's.vanilla\archives, which the build copy leaves out, so it is downloaded once and not for every install;bootstrap.ps1verifies it and downloads it again if it does not match.Assert-SafeInstallerPaths). The wizard no longer requires it, browses for it or reads its version, and the version is no longer picked from it. The state and helpers that only served that (Resolve-EffectiveVersion,Get-SupportedVsVersions, the browse button,detectedVsPath) are removed.-VsPathstays as an optional hint for the folder guard.install-macos.shkeeps--uninstall, so an install made by an older version of the script can still be removed, and refuses to install with a message that points todotnet run --project Optimum.Installer -c Releaseorscripts/package-macos.sh.Install Vintage Story $requiredVer before Optimum,-VanillaDir $VsPath) now asserts the new one and also that__skip__and a junction are gone.Evidence
I ran
install-windows.ps1 -Silenton an earlier revision of this branch, before the archive cache and the removal of the dead wizard code, which I checked by parsing under Windows PowerShell 5.1 and 7 and by reading. It downloaded the 598 MB client,bootstrap.ps1accepted it, extracted it and checked the library, the build and packaging finished, and the log has no reference to an installed Vintage Story. The installedOptimum.exethen launched with an empty patch cache and its patch loop and validation passed.install-windows.ps1parses under Windows PowerShell 5.1 and PowerShell 7, and the 45 installer related tests inOptimum.Testspass.Not covered
I could not run the WinForms wizard, so the changed wizard code is checked by parsing and by reading only.
RiftLauncherandoptimum patchstill patch a player's game in place on purpose, andinstall-linux.shonly detects the data folder, so neither is touched.