Table of Contents

Class ImplementationStores

Namespace
ZeroInstall.Store.Implementations
Assembly
ZeroInstall.Store.dll

Manages implementation store directories and provides IImplementationStore instances.

public static class ImplementationStores
Inheritance
object
ImplementationStores

Methods

Default(ITaskHandler)

Creates an IImplementationStore instance that uses the default cache locations (based on ImplementationStores.

public static IImplementationStore Default(ITaskHandler handler)

Parameters

handler ITaskHandler

A callback object used when the user is to be informed about progress or asked questions.

Returns

IImplementationStore

Exceptions

IOException

There was a problem accessing a configuration file or one of the stores.

UnauthorizedAccessException

Access to a configuration file or one of the stores was not permitted.

GetDirectories(bool)

Returns a list of paths for implementation directories as defined by configuration files including the default locations.

[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Reads data from a config file with no caching")]
public static IEnumerable<string> GetDirectories(bool serviceMode = false)

Parameters

serviceMode bool

true to exclude the default location in the user profile, e.g., for system services.

Returns

IEnumerable<string>

Remarks

Multiple configuration files apply cumulatively. I.e., directories from both the user config and the system config are used.

Exceptions

IOException

There was a problem accessing a configuration file or one of the stores.

UnauthorizedAccessException

Access to a configuration file was not permitted.

GetMachineWideDirectories()

Returns a list of custom implementation directories in the current machine-wide configuration.

[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "May throw exceptions")]
public static IEnumerable<string> GetMachineWideDirectories()

Returns

IEnumerable<string>

Exceptions

IOException

There was a problem accessing a configuration file.

UnauthorizedAccessException

Access to a configuration file was not permitted.

GetUserDefaultDirectory()

Returns the path of the default per-user implementation directory.

public static string GetUserDefaultDirectory()

Returns

string

A fully qualified directory path. The directory is guaranteed to already exist.

GetUserDirectories()

Returns a list of custom implementation directories in the current user configuration.

[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "May throw exceptions")]
public static IEnumerable<string> GetUserDirectories()

Returns

IEnumerable<string>

Exceptions

IOException

There was a problem accessing a configuration file.

UnauthorizedAccessException

Access to a configuration file was not permitted.

SetMachineWideDirectories(IEnumerable<string>)

Sets the list of custom implementation directories in the current machine-wide configuration.

public static void SetMachineWideDirectories(IEnumerable<string> paths)

Parameters

paths IEnumerable<string>

The list of implementation directories to set.

Exceptions

IOException

There was a problem writing a configuration file.

UnauthorizedAccessException

Access to a configuration file was not permitted.

SetUserDirectories(IEnumerable<string>)

Sets the list of custom implementation directories in the current user configuration.

public static void SetUserDirectories(IEnumerable<string> paths)

Parameters

paths IEnumerable<string>

The list of implementation directories to set.

Exceptions

IOException

There was a problem writing a configuration file.

UnauthorizedAccessException

Access to a configuration file was not permitted.

TryGetSystemDefaultDirectory()

Returns the path of the default machine-wide implementation directory.

public static string? TryGetSystemDefaultDirectory()

Returns

string

null if the directory could not be created due to insufficient permissions. Otherwise: A fully qualified directory path. The directory is guaranteed to already exist.