Table of Contents

Client library

The ZeroInstall.Client namespace allows you to invoke Zero Install commands from within other applications.

Use Detect to automatically discover the locations of the 0install and/or 0install-win executables. This gives you an instance of IZeroInstallClient, which enables easy programmatic access to a subset of the Command-line interface.


Detect 0install location and the feed URI used to launch the app:

var zeroInstall = ZeroInstallClient.Detect;
var feedUri = ZeroInstallEnvironment.FeedUri ?? new FeedUri("");

Download updates if available:

if (await zeroInstall.UpdateAsync(feedUri))

Restart the app to run the latest version:


Toggle the app's auto start desktop integration:

bool isAutoStartEnabled = (await zeroInstall.GetIntegrationAsync(feedUri)).Contains("auto-start");
if (isAutoStartEnabled)
    await zeroInstall.IntegrateAsync(feedUri, remove: new[] {"auto-start"});
    await zeroInstall.IntegrateAsync(feedUri, add: new[] {"auto-start"});

Error handling

The client library maps 0install's exit codes to exceptions. Your code should be ready to catch: