Table of Contents

Class CaptureSession

Namespace
ZeroInstall.Publish.Capture
Assembly
ZeroInstall.Publish.dll

Manages the process of taking two Snapshots and comparing them to generate a Feed.

public class CaptureSession
Inheritance
CaptureSession
Inherited Members

Properties

InstallationDir

The fully qualified path to the installation directory; leave null or empty for auto-detection.

public string? InstallationDir { get; set; }

Property Value

string

Methods

CollectFiles(string, Uri, ITaskHandler)

Creates a archive containing the InstallationDir.

public void CollectFiles(string archivePath, Uri archiveUrl, ITaskHandler handler)

Parameters

archivePath string

The path of the archive file to create.

archiveUrl Uri

The URL where the archive will be uploaded.

handler ITaskHandler

A callback object used when the the user needs to be informed about IO tasks.

Remarks

Exceptions

InvalidOperationException

Diff(ITaskHandler) was not called or MainCandidate is not set.

OperationCanceledException

The user canceled the task.

IOException

There was an error reading the installation files or writing the archive.

UnauthorizedAccessException

Access to the file system was not permitted.

NotSupportedException

The MIME type inferred from the archivePath doesn't belong to a known and supported archive type.

Diff(ITaskHandler)

Collects data from the locations indicated by the differences between the Start(FeedBuilder) state and the current system state.

public void Diff(ITaskHandler handler)

Parameters

handler ITaskHandler

A callback object used when the the user needs to be informed about IO tasks.

Exceptions

InvalidOperationException

No installation directory was detected.

OperationCanceledException

The user canceled the task.

IOException

There was an error accessing the registry or file system.

UnauthorizedAccessException

Access to the registry or file system was not permitted.

Finish()

Finishes the capture process after Diff(ITaskHandler) has been called an MainCandidate has been set.

public void Finish()

Exceptions

InvalidOperationException

Diff(ITaskHandler) was not called or MainCandidate is not set.

IOException

There was an error accessing the registry or file system.

UnauthorizedAccessException

Access to the registry or file system was not permitted.

Load(string, FeedBuilder)

Loads a capture session from a snapshot file.

public static CaptureSession Load(string path, FeedBuilder feedBuilder)

Parameters

path string

The file to load from.

feedBuilder FeedBuilder

All collected data is stored into this builder. You can perform additional modifications before using Build() to get a feed.

Returns

CaptureSession

Exceptions

IOException

A problem occurred while reading the file.

UnauthorizedAccessException

Read access to the file is not permitted.

InvalidDataException

A problem occurred while deserializing the binary data.

Save(string)

Saves the capture session to a snapshot file.

public void Save(string path)

Parameters

path string

The file to save in.

Exceptions

IOException

A problem occurred while writing the file.

UnauthorizedAccessException

Write access to the file is not permitted.

Start(FeedBuilder)

Captures the current system state as a snapshot of the system state before the target application was installed.

public static CaptureSession Start(FeedBuilder feedBuilder)

Parameters

feedBuilder FeedBuilder

All collected data is stored into this builder. You can perform additional modifications before using Build() to get a feed.

Returns

CaptureSession

Exceptions

IOException

There was an error accessing the registry or file system.

UnauthorizedAccessException

Access to the registry or the file system was not permitted.