selfupdate

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package selfupdate downloads, verifies, and installs release binaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupStaleHelpers

func CleanupStaleHelpers(binaryName string)

CleanupStaleHelpers removes old Windows update helpers after they are no longer executing. Cleanup is intentionally best-effort.

func CompletePendingReplacement

func CompletePendingReplacement(targetPath, binaryName string) error

CompletePendingReplacement is the private helper used by a downloaded Windows binary after the original process exits.

Types

type Config

type Config struct {
	BinaryName            string
	ReleaseAPI            string
	SigningKeyRegistryAPI string
	CurrentVersion        string
	ExecutablePath        string
	GOOS                  string
	GOARCH                string
	Force                 bool
	HTTPClient            *http.Client
	Progressf             func(string, ...any)
}

Config supplies runtime identity and optional test overrides.

type Result

type Result struct {
	PreviousVersion string `json:"previousVersion"`
	Version         string `json:"version"`
	Channel         string `json:"channel"`
	ExecutablePath  string `json:"executablePath"`
	Changed         bool   `json:"changed"`
	PendingRestart  bool   `json:"pendingRestart"`
}

Result describes the selected release and whether installation changed.

func Run

func Run(ctx context.Context, config Config) (Result, error)

Run selects the latest release, verifies its signed checksums and archive, and replaces the current executable atomically where the OS permits it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL