--- status: accepted --- # Package with Velopack's packer and authenticate updates with our own signed manifest Arena Tracker installs per user with Velopack 1.2.161 (`scripts/package`), but only its packer is used: the app never calls the Velopack SDK. In that version the SDK's startup path opens cached packages to read their manifests even with auto-apply disabled, and nothing in Velopack checks a package against a project key. Each release therefore carries a manifest signed with the project's Ed25519 key, binding the app, the Windows target, the version, the channel and the source commit to the SHA-256 of one full package. The core's `verify_release` checks it before anything opens the package as an archive. Releases contain full packages only. Velopack also installs a root launcher, `Arena Tracker.exe`, which runs `Update.exe start`. If the installed manifest is unreadable, that command opens the latest `packages\*.nupkg` to read its manifest, and if an `app-*` folder exists it applies that package without any signature check. Our Start Menu shortcut targets `current\arena-tracker.exe` and never runs the launcher. Both paths need a file written into `%LOCALAPPDATA%\ArenaTracker` by the same Windows account, which could equally replace the app's executable. We accept this residual path (decided on 2026-11-20, as #57 required before adopting Velopack). The MSVC C runtime is linked statically (`.cargo/config.toml`), so a package ships no `vcruntime140.dll` that would vary with the build machine's Visual Studio redistributable. ## Considered Options - **Velopack SDK at startup**: automatic updates for free, but it opens unauthenticated local packages before the app can check them. - **Delete the installer's package copy after each install or update**: leaves the launcher nothing to open, at the cost of altering files Velopack manages; it protects only against a writer who can already replace the app. - **Our own installer and updater**: no residual path, but a much larger amount of code to write and maintain. - **Packer only, own signed manifest, accepted launcher path** (chosen). ## Consequences - The updater must download into a folder outside the installation and Velopack's cache, call `verify_release` there, and hand exactly those verified bytes to Velopack; unverified bytes never enter `%LOCALAPPDATA%\ArenaTracker`, even after an interrupted download. - Applying runs `Update.exe apply --waitPid --package ` on the file just verified again, which Velopack reads in place. Its folder swap has no rollback: a power cut between its two renames leaves no `current` folder until a reinstall (accepted; `docs/paquets-windows.md`, « Application de la mise à jour »). - Delta packages stay off (`--delta None`) until their preparation path can be authenticated too. - Upgrading Velopack means re-reading its startup, locator and install code for new paths that open local packages. - The private key never enters the repository, the app or the artefacts; only its public key is built into the executable.