feat(builder): hand a 2.x install over to the Hookshot Launcher #2722
Open
github-sync
wants to merge 2 commits from
github/pr/2722 into main
pull from: github/pr/2722
merge into: MagicBeanDev:main
MagicBeanDev:main
MagicBeanDev:github/pr/2893
MagicBeanDev:github/pr/2890
MagicBeanDev:github/pr/2887
MagicBeanDev:github/pr/2878
MagicBeanDev:github/pr/2875
MagicBeanDev:github/pr/2874
MagicBeanDev:github/pr/2873
MagicBeanDev:github/pr/2871
MagicBeanDev:github/pr/2756
MagicBeanDev:github/pr/2897
MagicBeanDev:github/pr/2896
MagicBeanDev:github/pr/2718
MagicBeanDev:github/pr/2842
MagicBeanDev:github/pr/2691
MagicBeanDev:github/pr/2895
MagicBeanDev:github/pr/2743
MagicBeanDev:github/pr/2765
MagicBeanDev:github/pr/2708
MagicBeanDev:github/pr/2732
MagicBeanDev:github/pr/2755
MagicBeanDev:github/pr/2817
MagicBeanDev:github/pr/2876
MagicBeanDev:release-please--branches--main
MagicBeanDev:release-please--branches--main--release-notes
MagicBeanDev:github/pr/2778
MagicBeanDev:github/pr/2888
MagicBeanDev:github/pr/2866
MagicBeanDev:github/pr/2877
MagicBeanDev:github/pr/2800
MagicBeanDev:github/pr/2829
MagicBeanDev:github/pr/2850
MagicBeanDev:github/pr/2889
MagicBeanDev:github/pr/2882
MagicBeanDev:github/pr/2860
MagicBeanDev:github/pr/2849
MagicBeanDev:github/pr/2886
MagicBeanDev:github/pr/2794
MagicBeanDev:github/pr/2840
MagicBeanDev:github/pr/2830
MagicBeanDev:github/pr/2834
MagicBeanDev:github/pr/2719
MagicBeanDev:github/pr/2742
MagicBeanDev:github/pr/2741
MagicBeanDev:github/pr/2820
MagicBeanDev:github/pr/2771
MagicBeanDev:github/pr/2859
MagicBeanDev:github/pr/2858
MagicBeanDev:github/pr/2823
MagicBeanDev:github/pr/2757
MagicBeanDev:github/pr/2769
MagicBeanDev:github/pr/2844
MagicBeanDev:github/pr/2843
MagicBeanDev:github/pr/2673
MagicBeanDev:github/pr/2855
MagicBeanDev:github/pr/2739
MagicBeanDev:github/pr/2807
MagicBeanDev:github/pr/2851
MagicBeanDev:github/pr/2789
MagicBeanDev:github/pr/2814
MagicBeanDev:github/pr/2818
MagicBeanDev:github/pr/2774
MagicBeanDev:github/pr/2772
MagicBeanDev:github/pr/2750
MagicBeanDev:github/pr/2786
MagicBeanDev:github/pr/2785
MagicBeanDev:github/pr/2782
MagicBeanDev:github/pr/2779
MagicBeanDev:github/pr/2775
MagicBeanDev:github/pr/2706
MagicBeanDev:github/pr/2766
MagicBeanDev:github/pr/2747
MagicBeanDev:github/pr/2759
MagicBeanDev:github/pr/2745
MagicBeanDev:github/pr/2740
MagicBeanDev:github/pr/2733
MagicBeanDev:github/pr/2725
MagicBeanDev:github/pr/2727
MagicBeanDev:github/pr/2728
MagicBeanDev:github/pr/2729
MagicBeanDev:github/pr/2721
MagicBeanDev:github/pr/2715
MagicBeanDev:github/pr/2714
MagicBeanDev:github/pr/2707
MagicBeanDev:github/pr/2703
MagicBeanDev:github/pr/2705
MagicBeanDev:github/pr/2697
MagicBeanDev:github/pr/2679
MagicBeanDev:github/pr/2676
MagicBeanDev:github/pr/2669
MagicBeanDev:docs/what-hookshot-connects-to
MagicBeanDev:fix/hdr-encode-test
MagicBeanDev:fix/main-tests
MagicBeanDev:fix/play-cache-files
MagicBeanDev:perf/game-barrier-order
MagicBeanDev:feat/heap-lazy
MagicBeanDev:feat/texture-detail
MagicBeanDev:perf/astc-opaque-bc1
MagicBeanDev:fix/fs-dir-lock
MagicBeanDev:fix/framegen-native-kept
MagicBeanDev:fix/update-no-downgrade
MagicBeanDev:port/k10-gcn-f16-mirrors
MagicBeanDev:fix/framegen-mult-cap
MagicBeanDev:chore/release-as-2.1.1
MagicBeanDev:perf/pcache-load-switch
MagicBeanDev:fix/prepare-progress-log
MagicBeanDev:fix/update-closes-stale-game
MagicBeanDev:fix/hdr-scaled-sampled
MagicBeanDev:perf/first-start-preset
MagicBeanDev:perf/zero-upload
MagicBeanDev:fix/vcore-escape-2s
MagicBeanDev:test/fake-gh-atomic
MagicBeanDev:perf/batch-idle-flush
MagicBeanDev:test/finish-stub-a
MagicBeanDev:chore/record-2.1.0
MagicBeanDev:fix/main-red-tests
MagicBeanDev:fix/test-display-startup-driver-cache
MagicBeanDev:feat/mesh-shader-mode
MagicBeanDev:fix/menu-probes-at-startup
MagicBeanDev:fix/fps-counter-classic
MagicBeanDev:fix/test-log-batch-flake
MagicBeanDev:fix/narrow-screen-hud
MagicBeanDev:ci/prereleases
MagicBeanDev:release/v2.0.15
MagicBeanDev:hotfix/v2.0.15
MagicBeanDev:fix/present-ahead-replay
MagicBeanDev:release/v2.0.13
MagicBeanDev:fix/bracket-paths-2013
MagicBeanDev:fix/hdr-overlays-2013
MagicBeanDev:fix/fps-counter-scale-2013
MagicBeanDev:fix/stick-seen-at-rest
MagicBeanDev:hotfix/menu-fits-screen
MagicBeanDev:fix/f1-always-opens-menu
MagicBeanDev:fix/ini-keep-lines
MagicBeanDev:claude/cranky-pike-7cf247
MagicBeanDev:perf/texture-answer-flat
MagicBeanDev:fix/stamp-test-modules
MagicBeanDev:fix/appimage-fonts
MagicBeanDev:fix/display-awake
MagicBeanDev:release/v2.0.12
MagicBeanDev:fix/discord-windows
MagicBeanDev:rc/v2.0.12-tests
MagicBeanDev:fix/dlss-keep-feature
MagicBeanDev:rc/v2.0.12
MagicBeanDev:button-icons
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
autorelease: pending
autorelease: tagged
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
github_actions
Pull requests that update GitHub Actions code
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
testing wanted
wontfix
This will not be worked on
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!2722
Loading…
Reference in a new issue
No description provided.
Delete branch "github/pr/2722"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hookshot 3 replaces the Builder with a new launcher, and a player on 2.x has no way to get there from the Builder they already have. With this PR, the 2.2/2.3 Builder offers the move when a release ships the launcher: one click installs it and hands the game folder over, with the player's build settings.
This is the second of three PRs: #2733 (nightly naming), then this one, then the launcher itself (#2739). It doesn't depend on the launcher's code. The two sides agree through a written contract (
docs/launcher-upgrade.md) and sample files that both test against.What changed
The contract (
docs/launcher-upgrade.md,tests/fixtures/launcher/):hookshot-launcher.txt, with the launcher's SHA-256, size and https link for each platform. A 404 means a Builder release, which updates as it does today. The version name is never used to decide, so the nightly renaming tonightly-<count>-<sha8>doesn't affect it. A tag is only used to find its release (release_of, the same rule the updater uses).%LOCALAPPDATA%\HookshotLauncher,~/.local/share/hookshot/launcher), and how it is installed whole.hookshot_version.txt: onlybuilder=.builder_args=goes, and a portable folder (builder_local=1) is left alone.The upgrader (
builder/HookshotBuilder/Upgrader.cs,builder/linux/linux_upgrade.py, and the two Builder windows):app.partand swaps it in by renames. Zip entries that would land outsideapp.partare refused. The oldappis renamed aside rather than deleted, so a file in use can't leave half a launcher behind.Hookshot.AppImage.partand renames it over the old file.--launch <folder>, and closes.--launchand--updateon to it. A portable Windows Builder doesn't. This means the game folder's own launcher and the game's update offer keep working.host/hos_update.cprefers an installed launcher over the installed 2.x Builder.AppRunon Linux,Tools.Find()on Windows).hookshot_builder.py --handover, used internally byAppRun.docs/versioning.mddescribes the upgrade.Failure handling:
.partfile is left behind.How it was tested
tests/test_linux_upgrade.py(30 tests) covers:AppRunbridge, run with a fake AppDirbegin_update,apply_modeandmain, compiled from source with no Tkhos_update.c'sinstalled_launcher, compiled withcctests/test_builder_upgrade.pycompiles the realUpgrader.cs,Updater.cs,BuilderSettings.cs,BuilderHome.csandStrings.cswith a fake window (52 checks). It covers:../entry, a zip withoutHookshotLauncher.exe, a cancelled install, and a replacement that leaves no stale filespython -I -B tests/run_all.pyon Linux: 423 passed, 67 skipped, 3 failed.test_bake_portabilityandtest_builder_log_read_onlyneedzstandardandlibtk, which this PC doesn't have.test_release_scriptshit a timing failure in its two-runs-at-once nightly case under the parallel run. It passes on its own, and this PR doesn't touch the release scripts.What was not tested
MainWindow.xaml.cs's mode logic, the running-launcher check and the rename swap with real file locks are untested.Upgrader.cswas built and checked on Linux with the .NET 10 SDK, not on Windows with .NET 8.libtk. The Linux hand-over screen, its Cancel button and the error screen were only exercised as functions compiled from the source.hookshot-launcher.txtyet, and the launcher is the next PR.Screenshots: none. Neither the WPF nor the Tk hand-over screen could be run on this PC, so there's nothing real to show yet. I'll add them once the screens run on Windows and on a Linux setup with Tk.
Follow-ups
%LOCALAPPDATA%rather than beside it. The folder's stamp is left alone, and the portable Builder no longer forwards to the launcher, so nothing breaks. A portable launcher home would be its own change.hookshot-launcher.txtand the bridge payloads described in section 5 of the contract. That belongs with the launcher's release.Thanks for writing this as a contract with shared sample files. It made it easy to build the other side against. I've integrated it with the standalone launcher I've been working on for 3.0 (Avalonia, Windows and Linux), and ran both sides together. Branch: https://github.com/madebyjordan/Longshot/tree/launcher/avalonia
The launcher side now meets
docs/launcher-upgrade.md:HookshotLauncher.exeat the zip's root, installed in%LOCALAPPDATA%\HookshotLauncher\app(its own installer uses the same place, so a PC has one launcher whichever way it came).<home>/import/*.jsontaken in at every start, before the window shows; on Linux, a first start with nothing dropped readsbuilder.ini.--launch,--update <folder> [--tag] [--fetched],--play [<folder>].hookshot-launcher.txtwritten byscripts/launcher/manifest.pyand uploaded by the launcher workflow, behind a repository variable (CI_LAUNCHER_HANDOVER) so no release starts moving players until that's decided.tests/fixtures/launcher/files, and one also reads an import written by your ownlinux_upgrade.write_import.One difference to discuss: the launcher keeps its builds in the Builder's home (
HookshotBuilder,hookshot/builder), where it already installs and drives each release's builder, rather than its ownbuilds.json. So nothing needs moving at the hand-over, but a 2.x Builder's "Free up space" could still touch those versions. I'm happy to move them into the launcher's home if you'd rather it own them.Tested end to end
--update <folder> --tag v3.0.0) withHOOKSHOT_LAUNCHER_LISTpointing at a freshly published launcher AppImage. Upgrade installed it, wrote the import, rewrote the stamp (builder=to the launcher,builder_args=gone), started the launcher on the folder and closed. The launcher took the import in with thebuilder.inisettings. As far as I know this is the first time the Tk screen has run.Upgrader.Install,ImportFor,WriteImportandRewriteStampon the published zip, then the installed launcher started with--launch: same result.tests/test_builder_upgrade.pypasses on Windows with .NET 8 (52 of 52), which covers your note thatUpgrader.cswasn't built on Windows.Two things I found in this PR
tests/test_linux_upgrade.pypasses on Linux but fails 6 tests plus 1 error on Windows (path separators, file modes, CRLF, and runningAppRun). It has noRUN_ALL_SKIPfor Windows, sorun_all.pyon a Windows shard will run it.Upgrader.Probehas no local-list override like Linux'sHOOKSHOT_LAUNCHER_LIST, so the WPF hand-over screen can't be clicked through without a real release. Honouring the same variable on Windows would make it testable.Overlap with #2373: this PR conflicts with #2373 in
MainWindow.xaml,MainWindow.xaml.cs,builder/linux/hookshot_builder.pyandtests/test_linux_update_cancel.py. In the Tk Builder both PRs useself.launcherand the message kind"launcher"for different things (your offered release, and #2373's launcher screen). In my merge I renamed yours toself.offerand"offer", put the WPF hand-over screen over #2373's window, and sent #2373's Update and release rows through it. Whichever lands second can reuse that resolution from the branch above.