Skip to main content

Module self_replace

Module self_replace 

Source
Expand description

Per-install-method update download + install logic.

The update checker hands us a LatestRelease and the detected InstallMethod; this module picks the right artifact, downloads it, verifies its SHA256 against the published SHA256SUMS, and either self-replaces the running binary or triggers the platform installer.

Critical invariant: for package-manager installs we never download or replace anything. The package manager owns the binary; stomping on it would confuse the system. Callers should check InstallMethod before calling install_update, but the function defensively short-circuits on those variants anyway.

Enums§

InstallOutcome
What happened when the user clicked “Download update”.
UpdateError
Errors from the install pipeline. Distinguished so the UI can decide whether to show a retry affordance.

Functions§

install_update

Type Aliases§

ProgressCallback
Full install flow. Dispatches to the right strategy based on the detected install method.