Class CaptureSession
- Namespace
- ZeroInstall.Publish.Capture
- Assembly
- ZeroInstall.Publish.dll
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
Methods
CollectFiles(string, Uri, ITaskHandler)
Creates a archive containing the InstallationDir.
public void CollectFiles(string archivePath, Uri archiveUrl, ITaskHandler handler)
Parameters
archivePath
stringThe path of the archive file to create.
archiveUrl
UriThe URL where the archive will be uploaded.
handler
ITaskHandlerA callback object used when the user needs to be informed about IO tasks.
Remarks
Sets RetrievalMethod and calls GenerateDigest(ITaskHandler).
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
ITaskHandlerA callback object used when 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
stringThe file to load from.
feedBuilder
FeedBuilderAll collected data is stored into this builder. You can perform additional modifications before using Build() to get a feed.
Returns
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
stringThe 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
FeedBuilderAll collected data is stored into this builder. You can perform additional modifications before using Build() to get a feed.
Returns
Exceptions
- IOException
There was an error accessing the registry or file system.
- UnauthorizedAccessException
Access to the registry or the file system was not permitted.