windowsinstaller

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 14 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 windowsinstaller is the Windows installer runtime embedded as source by the nsgo tool. It builds with Go alone, independently of the UI engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendPayload

func AppendPayload(executable string, payload io.Reader) error

AppendPayload adds a ZIP and a fixed footer after the Go PE image. Signing happens afterward: Authenticode covers this overlay as well as the image.

func Extract

func Extract(destination string, m Manifest, archive *zip.Reader, progress func(uint64, uint64)) error

Extract validates the entire archive before touching destination, then writes only the manifest's files. Root confines junctions and symlinks as well as ..; an unrelated file in a user-selected installation directory stays untouched.

func OpenPayload

func OpenPayload(executable string) (*zip.Reader, io.Closer, error)

OpenPayload reads the archive in place instead of loading the app into RAM. A signature's certificate table and its alignment padding follow the footer.

func RemoveFiles

func RemoveFiles(destination string, m Manifest, keepUninstaller bool) error

RemoveFiles removes manifest files and empty directories, never recursively. The uninstaller runs from a temporary copy, so its installed image can go too.

func ValidPath

func ValidPath(name string) bool

ValidPath accepts portable relative payload paths. Windows applies its own reserved-name checks as well when it opens them inside an os.Root.

Types

type FileType

type FileType struct {
	ProgID, Name string
	Extensions   []string
}

FileType is an application-specific ProgID and its Open With extensions.

type Manifest

type Manifest struct {
	ID, Name, Version, Exe, Publisher string
	ARM64, Command, Uninstall         bool
	Files, Dirs                       []string
	FileTypes                         []FileType
	URLSchemes                        []string
	Names                             []Name
}

Manifest describes one per-user installation. The tool embeds it in both programs, so uninstall removes an explicit file list rather than a directory.

func (Manifest) UninstallKey

func (m Manifest) UninstallKey() string

UninstallKey is compatible with earlier NSIS installations of this app.

func (Manifest) Validate

func (m Manifest) Validate() error

Validate refuses a malformed embedded manifest before any filesystem or registry change. A directory chosen by the user never expands this file list.

type Name

type Name struct {
	Language uint16
	Text     string
}

Name is the app's display name in a Windows UI language.

Jump to

Keyboard shortcuts

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