installer

package
v2.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: GPL-3.0 Imports: 28 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

Index

Constants

This section is empty.

Variables

View Source
var ErrInsufficientSpace = errors.New("not enough free space for download")

ErrInsufficientSpace is a download that would not fit on the disk.

View Source
var ErrUnsafeArchive = errors.New("unsafe archive entry")

ErrUnsafeArchive is an archive entry that cannot be written safely: one that names a path outside the extraction folder, a link, or a device.

View Source
var ErrUnsafeMediaName = errors.New("remote media name is not a plain filename")

ErrUnsafeMediaName is returned for a download URL whose last path segment is not a plain filename. The name comes from a remote server, so it decides where on this device the download lands.

Functions

func ConfigureHTTPTransport added in v2.11.0

func ConfigureHTTPTransport()

ConfigureHTTPTransport applies the process TLS root configuration to the installer's custom timeout transport.

func DownloadHTTPFile

func DownloadHTTPFile(opts DownloaderArgs) error

func DownloadSMBFile

func DownloadSMBFile(opts DownloaderArgs) error

func InstallRemoteFile

func InstallRemoteFile(
	ctx context.Context,
	cfg *config.Instance,
	pl platforms.Platform,
	ui *uievents.Service,
	fileURL string,
	systemID string,
	preNotice string,
	displayName string,
	downloader func(opts DownloaderArgs) error,
) (string, error)

func InstallRemoteMedia added in v2.23.0

func InstallRemoteMedia(
	ctx context.Context,
	cfg *config.Instance,
	pl platforms.Platform,
	ui *uievents.Service,
	media *RemoteMedia,
	downloader func(opts DownloaderArgs) error,
) (string, error)

InstallRemoteMedia downloads media into the system's game folder, unless it is already there, and returns the local path to launch.

Types

type AuthTransport

type AuthTransport struct {
	Base http.RoundTripper
}

func (*AuthTransport) RoundTrip

func (t *AuthTransport) RoundTrip(req *http.Request) (*http.Response, error)

type DownloaderArgs

type DownloaderArgs struct {
	// contains filtered or unexported fields
}

type RemoteMedia added in v2.23.0

type RemoteMedia struct {
	// URL is fetched with the downloader.
	URL string
	// SystemID decides which folder the download lands in.
	SystemID string
	// FileName is the name saved on disk, or for an archive the folder it
	// is extracted into. Empty takes the last segment of URL.
	FileName string
	// DisplayName is shown while downloading. Empty uses the file name.
	DisplayName string
	// PreNotice is shown once the media is ready, before it launches.
	PreNotice string
	// LaunchExts are the extensions the system's launchers open, used to
	// pick the file to start from an extracted archive.
	LaunchExts []string
	// Size is the download size in bytes when known, so a download that
	// cannot fit is refused before it starts. Zero skips the check.
	Size int64
	// Archive is a zip of a game made of several files. It is extracted
	// into a folder named FileName and the zip deleted.
	Archive bool
}

RemoteMedia describes a game or media file to fetch onto the device.

Jump to

Keyboard shortcuts

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