Show / Hide Table of Contents

Interface IZeroInstallClient

Client for invoking Zero Install commands from within other applications.

Namespace: ZeroInstall.Client
Assembly: ZeroInstall.Client.dll
Syntax
public interface IZeroInstallClient

Methods

DownloadAsync(Requirements, Boolean)

Downloads a program and compatible versions of all of its dependencies.

Declaration
Task<Selections> DownloadAsync(Requirements requirements, bool refresh = false)
Parameters
Type Name Description
Requirements requirements

The requirements describing the program.

Boolean refresh

Fetch fresh copies of all used feeds.

Returns
Type Description
Task<Selections>

The downloaded implementations.

Exceptions
Type Condition
IOException

0install could not be launched or reported a problem accessing the filesystem.

WebException

0install reported a problem downloading a file.

OperationCanceledException

The user canceled the operation.

ExitCodeException

0install returned an unexpected error.

FetchAsync(Implementation)

Downloads a set of Implementations.

Declaration
Task FetchAsync(Implementation implementation)
Parameters
Type Name Description
Implementation implementation

The implementations to download.

Returns
Type Description
Task
Exceptions
Type Condition
IOException

0install could not be launched or reported a problem accessing the filesystem.

WebException

0install reported a problem downloading a file.

OperationCanceledException

The user canceled the operation.

ExitCodeException

0install returned an unexpected error.

GetIntegrationAsync(FeedUri, Boolean)

Returns the desktop integration categories that are currently applied for a specific feed.

Declaration
Task<ISet<string>> GetIntegrationAsync(FeedUri uri, bool machineWide = false)
Parameters
Type Name Description
FeedUri uri

The feed URI of the application.

Boolean machineWide

Get machine-wide desktop integration instead of just for the current user.

Returns
Type Description
Task<ISet<String>>

The access point categories (e.g., capability-registration, menu-entry, desktop-icon).

Exceptions
Type Condition
IOException

0install could not be launched or reported a problem accessing the filesystem.

WebException

0install reported a problem downloading a file.

OperationCanceledException

The user canceled the operation.

ExitCodeException

0install returned an unexpected error.

NotAdminException

machineWide was set but the current process is not running with admin rights.

GetRunStartInfo(Requirements, Boolean, Boolean, String[])

Provides a ProcessStartInfo for running a program via Zero Install. This allows you to wait for the program to exit and/or to capture its output.

Declaration
ProcessStartInfo GetRunStartInfo(Requirements requirements, bool refresh = false, bool needsTerminal = false, params string[] arguments)
Parameters
Type Name Description
Requirements requirements

The requirements describing the program.

Boolean refresh

Fetch fresh copies of all used feeds.

Boolean needsTerminal

Indicates that the program requires a terminal in order to run.

String[] arguments

Additional arguments to pass to the program.

Returns
Type Description
ProcessStartInfo

IntegrateAsync(FeedUri, IEnumerable<String>, IEnumerable<String>, Boolean)

Adds an application to the application list (if missing) and integrates it into the desktop environment.

Declaration
Task IntegrateAsync(FeedUri uri, IEnumerable<string> add = null, IEnumerable<string> remove = null, bool machineWide = false)
Parameters
Type Name Description
FeedUri uri

The feed URI of the application.

IEnumerable<String> add

The access point categories to add (e.g., capability-registration, menu-entry, desktop-icon).

IEnumerable<String> remove

The access point categories to remove (e.g., capability-registration, menu-entry, desktop-icon).

Boolean machineWide

Apply the operation machine-wide instead of just for the current user.

Returns
Type Description
Task
Exceptions
Type Condition
IOException

0install could not be launched or reported a problem accessing the filesystem.

WebException

0install reported a problem downloading a file.

OperationCanceledException

The user canceled the operation.

ExitCodeException

0install returned an unexpected error.

NotAdminException

machineWide was set but the current process is not running with admin rights.

RemoveAsync(FeedUri, Boolean)

Removes an application from the application list and undoes any desktop environment integration.

Declaration
Task RemoveAsync(FeedUri uri, bool machineWide = false)
Parameters
Type Name Description
FeedUri uri

The feed URI of the application.

Boolean machineWide

Apply the operation machine-wide instead of just for the current user.

Returns
Type Description
Task
Exceptions
Type Condition
IOException

0install could not be launched or reported a problem accessing the filesystem.

WebException

0install reported a problem downloading a file.

OperationCanceledException

The user canceled the operation.

ExitCodeException

0install returned an unexpected error.

NotAdminException

machineWide was set but the current process is not running with admin rights.

Run(Requirements, Boolean, Boolean, String[])

Runs a program via Zero Install. Does not wait for the program to exit.

Declaration
void Run(Requirements requirements, bool refresh = false, bool needsTerminal = false, params string[] arguments)
Parameters
Type Name Description
Requirements requirements

The requirements describing the program.

Boolean refresh

Fetch fresh copies of all used feeds.

Boolean needsTerminal

Indicates that the program requires a terminal in order to run.

String[] arguments

Additional arguments to pass to the program.

Exceptions
Type Condition
IOException

0install could not be launched or reported a problem accessing the filesystem.

WebException

0install reported a problem downloading a file.

OperationCanceledException

The user canceled the operation.

ExitCodeException

0install returned an unexpected error.

SelectAsync(Requirements, Boolean, Boolean)

Selects a program and compatible versions of all of its dependencies.

Declaration
Task<Selections> SelectAsync(Requirements requirements, bool refresh = false, bool offline = false)
Parameters
Type Name Description
Requirements requirements

The requirements describing the program.

Boolean refresh

Fetch fresh copies of all used feeds.

Boolean offline

Do not refresh feeds even if they are out-of-date and don't select newer versions of programs for downloading even if they are already known.

Returns
Type Description
Task<Selections>

The selected implementations.

Exceptions
Type Condition
IOException

0install could not be launched or reported a problem accessing the filesystem.

WebException

0install reported a problem downloading a file.

OperationCanceledException

The user canceled the operation.

ExitCodeException

0install returned an unexpected error.

TrustKey(String, String)

Trusts feeds from a specific domain when signed with a specific key.

Declaration
void TrustKey(string fingerprint, string domain)
Parameters
Type Name Description
String fingerprint

The fingerprint of the key to trust.

String domain

The domain the key should be trusted for.

In This Article
Back to top Copyright Bastian Eicher et al