Table of Contents

Class Download

Namespace
ZeroInstall.Commands.Basic
Assembly
0install.dll

This behaves similarly to Selection, except that it also downloads the selected versions if they are not already cached.

public class Download : Selection
Inheritance
Download
Derived
Inherited Members

Constructors

Download(ICommandHandler)

Creates a new download command.

public Download(ICommandHandler handler)

Parameters

handler ICommandHandler

A callback object used when the user needs to be asked questions or informed about download and IO tasks.

Download(ICommandHandler, bool, bool, bool)

Creates a new download command.

protected Download(ICommandHandler handler, bool outputOptions = true, bool refreshOptions = true, bool customizeOptions = true)

Parameters

handler ICommandHandler

A callback object used when the user needs to be asked questions or informed about download and IO tasks.

outputOptions bool

Whether to add command-line options controlling output.

refreshOptions bool

Whether to add command-line options controlling refresh behavior.

customizeOptions bool

Whether to add command-line options for customizing selected implementations.

Fields

Name

public const string Name = "download"

Field Value

string

UncachedImplementations

Implementations referenced in Selections that are not available in the IImplementationStore.

protected List<Implementation>? UncachedImplementations

Field Value

List<Implementation>

Properties

Description

A short description of what this command does.

public override string Description { get; }

Property Value

string

MinimumNetworkUseForBackgroundSelfUpdate

The minimum EffectiveNetworkUse at which BackgroundSelfUpdate() will consider an update check.

protected override NetworkLevel MinimumNetworkUseForBackgroundSelfUpdate { get; }

Property Value

NetworkLevel

Methods

BackgroundSelfUpdateAndClean()

Automatically updates Zero Install itself in a background process. If no update check is due and we are in IsLibraryMode instead removes outdated implementations in a background process.

protected void BackgroundSelfUpdateAndClean()

DownloadUncachedImplementations()

Downloads any Implementations in Selection that are missing from IImplementationStore.

protected void DownloadUncachedImplementations()

Remarks

Makes sure ISolver ran with up-to-date feeds before downloading any implementations.

Execute()

Executes the commands specified by the command-line arguments. Must call Parse(IReadOnlyList<string>) first!

public override ExitCode Execute()

Returns

ExitCode

The exit status code to end the process with.

Remarks

When inheriting this method is usually replaced.

Exceptions

OperationCanceledException

The user canceled the task.

OptionException

The number of arguments passed in on the command-line is incorrect.

WebException

A file could not be downloaded from the internet.

NotSupportedException

A file format, protocol, etc. is unknown or not supported.

IOException

A downloaded file could not be written to the disk or extracted or an external application or file required by the solver could not be accessed.

UnauthorizedAccessException

An operation failed due to insufficient rights.

InvalidDataException

A problem occurred while deserializing an XML file.

SignatureException

The signature data could not be handled for some reason.

FormatException

An URI, local path, version number, etc. is invalid.

DigestMismatchException

An Implementation's Archives don't match the associated ManifestDigest.

SolverException

The ISolver was unable to provide Selections that fulfill the Requirements.

ImplementationNotFoundException

One of the ImplementationBases is not cached yet.

ExecutorException

The IExecutor was unable to process the Selections.

ShowOutput()

protected override ExitCode ShowOutput()

Returns

ExitCode

Solve()

Runs Solve(Requirements) (unless SelectionsDocument is true) and stores the result in Selections.

protected override void Solve()

Exceptions

OperationCanceledException

The user canceled the task.

WebException

A file could not be downloaded from the internet.

IOException

An external application or file required by the solver could not be accessed.

SolverException

The ISolver was unable to provide Selections that fulfill the Requirements.