wininstall

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package wininstall installs the desktop app on Windows for one user, without an administrator (spec_038_electron EL-81): the app's zip, carried at the end of the setup program (Payload), unpacked in %LOCALAPPDATA%\Programs\Blitz (Unpack, Place), and its entry in Add or remove programs (Entry, in the registry on Windows). The setup program (apps/electron/winsetup) and the tray's updates use it; what isn't the registry works, and is tested, everywhere.

Index

Constants

View Source
const (
	// UninstallKey is the app's entry in Add or remove programs, under
	// HKEY_CURRENT_USER.
	UninstallKey = `Software\Microsoft\Windows\CurrentVersion\Uninstall\Blitz`
	// Uninstaller is the setup program's name in the installed app, where
	// it uninstalls (it's in the zip, so an update keeps it).
	Uninstaller = "Uninstall Blitz.exe"
	// App is the app's program in its folder.
	App = "Blitz.exe"
	// Marker is the file the setup program leaves in the folder it
	// installs: the uninstaller removes only a folder that has it (or the
	// folder the entry in Add or remove programs names).
	Marker = "Blitz install.txt"
)

Variables

View Source
var ErrNoPayload = errors.New("no app in this program")

ErrNoPayload means the program carries no zip: it's the uninstaller.

Functions

func AppendPayload

func AppendPayload(w io.Writer, zipData []byte) error

AppendPayload writes zip after what's already been written to w (the setup program), followed by its length and magic.

func DefaultRoot

func DefaultRoot(localAppData string) string

DefaultRoot is where the app goes: %LOCALAPPDATA%\Programs\Blitz, as other per-user installs do.

func DeleteEntry

func DeleteEntry() error

DeleteEntry removes the app's entry (Windows only).

func InstallLocation added in v0.9.1

func InstallLocation() string

InstallLocation is the folder the app's entry names: none but on Windows.

func Payload

func Payload(exe io.ReaderAt, size int64) (*zip.Reader, error)

Payload is the zip at the end of a program of size bytes, or ErrNoPayload.

func Place

func Place(staged, root string) error

Place puts the unpacked app (staged) at root: an app already there is moved aside first and removed after, so a failure leaves one in place.

func SetDisplayVersion

func SetDisplayVersion(string) error

SetDisplayVersion updates the entry's version (nothing to do but on Windows).

func Size

func Size(dir string) int64

Size is how much the files under dir take, in KB (Add or remove programs shows it).

func TrayVersion

func TrayVersion(out string) string

TrayVersion is the version in blitz-tray --version's line ("" when it isn't one).

func Unpack

func Unpack(zr *zip.Reader, dest, strip string) error

Unpack writes the zip's files under dest, without the folder they're in (the zip's Blitz\). A file that would land outside dest is refused.

func WriteEntry

func WriteEntry(Entry) error

WriteEntry writes the app's entry in Add or remove programs (Windows only).

Types

type Entry

type Entry struct {
	Root    string
	Version string
	// SizeKB is what the app takes.
	SizeKB int64
}

Entry is the app's entry in Add or remove programs.

func (Entry) Numbers

func (e Entry) Numbers() map[string]uint32

Numbers are the entry's number values: no Modify or Repair, and its size.

func (Entry) Strings

func (e Entry) Strings() map[string]string

Strings are the entry's text values, by name.

Jump to

Keyboard shortcuts

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