Table of Contents

Class Materializer

Namespace
ZeroInstall.Services.Executors
Assembly
ZeroInstall.Services.dll

Copies all implementations in a Selections document into a directory and generates a launcher script that sets up the environment the same way Executor would. The resulting directory can be run without Zero Install and can be moved to a different location.

public class Materializer
Inheritance
object
Materializer

Constructors

Materializer(IImplementationStore, ITaskHandler)

Copies all implementations in a Selections document into a directory and generates a launcher script that sets up the environment the same way Executor would. The resulting directory can be run without Zero Install and can be moved to a different location.

public Materializer(IImplementationStore implementationStore, ITaskHandler handler)

Parameters

implementationStore IImplementationStore

Used to locate the implementations to copy.

handler ITaskHandler

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

Properties

Clean

Remove content from earlier runs that is no longer needed: implementations that are no longer selected and unneeded files in ZeroInstall.Services.Executors.LauncherScriptBuilder.BinDir. Also replace existing copies with links or vice versa to match UseLinks.

public bool Clean { get; init; }

Property Value

bool

Remarks

Without this, existing files are left as-is, apart from the ones being regenerated.

TargetOS

The operating system the launcher scripts will run on. Defaults to the current system.

public OS TargetOS { get; init; }

Property Value

OS

Create links to the implementation directories instead of copying them.

public bool UseLinks { get; init; }

Property Value

bool

This is faster and saves disk space, but the resulting directory stops working when the implementations are removed.

Methods

Materialize(Selections, string, string)

Materializes a set of selections into a directory.

public string Materialize(Selections selections, string targetDir, string launcherName)

Parameters

selections Selections

The selections to materialize. All implementations must already be cached.

targetDir string

The directory to place the implementations and launcher scripts in. Created if it does not exist yet.

launcherName string

The file name for the main launcher script, without a file extension.

Returns

string

The full path of the file to run to start the program, including a file extension if TargetOS requires one.

Exceptions

ImplementationNotFoundException

One of the Implementations is not cached yet.

ExecutorException

The Selections cannot be expressed as a launcher script.

OperationCanceledException

The user canceled the task.

IOException

A problem occurred while reading or writing files.

UnauthorizedAccessException

Read or write access to a file is not permitted.