Zero Install .NET API 2.20.0
ZeroInstall.Publish.Capture.CaptureSession Class Reference

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

Public Member Functions

void Diff (ITaskHandler handler)
 Collects data from the locations indicated by the differences between the Start state and the current system state. More...
 
void Finish ()
 Finishes the capture process after Diff has been called an FeedBuilder.MainCandidate has been set. More...
 
void CollectFiles (string archivePath, Uri archiveUrl, ITaskHandler handler)
 Creates a archive containing the InstallationDir. More...
 
void Save (string path)
 Saves the capture session to a snapshot file. More...
 

Static Public Member Functions

static CaptureSession Start (FeedBuilder feedBuilder)
 Captures the current system state as a snapshot of the system state before the target application was installed. More...
 
static CaptureSession Load (string path, FeedBuilder feedBuilder)
 Loads a capture session from a snapshot file. More...
 

Properties

string? InstallationDir [getset]
 The fully qualified path to the installation directory; leave null or empty for auto-detection.
 

Detailed Description

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

Member Function Documentation

◆ CollectFiles()

void ZeroInstall.Publish.Capture.CaptureSession.CollectFiles ( string  archivePath,
Uri  archiveUrl,
ITaskHandler  handler 
)
inline

Creates a archive containing the InstallationDir.

Sets FeedBuilder.RetrievalMethod and calls FeedBuilder.GenerateDigest.

Parameters
archivePathThe path of the archive file to create.
archiveUrlThe URL where the archive will be uploaded.
handlerA callback object used when the the user needs to be informed about IO tasks.
Exceptions
InvalidOperationExceptionDiff was not called or FeedBuilder.MainCandidate is not set.
OperationCanceledExceptionThe user canceled the task.
IOExceptionThere was an error reading the installation files or writing the archive.
UnauthorizedAccessExceptionAccess to the file system was not permitted.
NotSupportedExceptionThe MIME type inferred from the archivePath doesn't belong to a known and supported archive type.

◆ Diff()

void ZeroInstall.Publish.Capture.CaptureSession.Diff ( ITaskHandler  handler)
inline

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

Parameters
handlerA callback object used when the the user needs to be informed about IO tasks.
Exceptions
InvalidOperationExceptionNo installation directory was detected.
OperationCanceledExceptionThe user canceled the task.
IOExceptionThere was an error accessing the registry or file system.
UnauthorizedAccessExceptionAccess to the registry or file system was not permitted.

◆ Finish()

void ZeroInstall.Publish.Capture.CaptureSession.Finish ( )
inline

Finishes the capture process after Diff has been called an FeedBuilder.MainCandidate has been set.

Exceptions
InvalidOperationExceptionDiff was not called or FeedBuilder.MainCandidate is not set.
IOExceptionThere was an error accessing the registry or file system.
UnauthorizedAccessExceptionAccess to the registry or file system was not permitted.

◆ Load()

static CaptureSession ZeroInstall.Publish.Capture.CaptureSession.Load ( string  path,
FeedBuilder  feedBuilder 
)
static

Loads a capture session from a snapshot file.

Parameters
pathThe file to load from.
feedBuilderAll collected data is stored into this builder. You can perform additional modifications before using FeedBuilder.Build to get a feed.
Exceptions
IOExceptionA problem occurred while reading the file.
UnauthorizedAccessExceptionRead access to the file is not permitted.
InvalidDataExceptionA problem occurred while deserializing the binary data.

◆ Save()

void ZeroInstall.Publish.Capture.CaptureSession.Save ( string  path)

Saves the capture session to a snapshot file.

Parameters
pathThe file to save in.
Exceptions
IOExceptionA problem occurred while writing the file.
UnauthorizedAccessExceptionWrite access to the file is not permitted.

◆ Start()

static CaptureSession ZeroInstall.Publish.Capture.CaptureSession.Start ( FeedBuilder  feedBuilder)
static

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

Parameters
feedBuilderAll collected data is stored into this builder. You can perform additional modifications before using FeedBuilder.Build to get a feed.
Exceptions
IOExceptionThere was an error accessing the registry or file system.
UnauthorizedAccessExceptionAccess to the registry or the file system was not permitted.

The documentation for this class was generated from the following file: