Table of Contents

Class Config

Namespace
ZeroInstall.Store.Configuration
Assembly
ZeroInstall.Store.dll

User settings controlling network behaviour, solving, etc..

[Serializable]
public sealed class Config : IEnumerable<KeyValuePair<string, string>>, IEnumerable, ICloneable<Config>, IEquatable<Config>
Inheritance
Config
Implements
Inherited Members

Constructors

Config()

Creates a new configuration with default values set.

public Config()

Fields

DefaultExternalSolverUri

The default value for ExternalSolverUri.

public const string DefaultExternalSolverUri = "https://apps.0install.net/0install/0install-ocaml.xml"

Field Value

string

DefaultFeedMirror

The default value for FeedMirror.

public const string DefaultFeedMirror = "https://roscidus.com/0mirror"

Field Value

string

DefaultKeyInfoServer

The default value for KeyInfoServer.

public const string DefaultKeyInfoServer = "https://keylookup.0install.net/"

Field Value

string

DefaultMaxParallelDownloads

The default value for MaxParallelDownloads.

public const int DefaultMaxParallelDownloads = 4

Field Value

int

DefaultSelfUpdateUri

The default value for SelfUpdateUri.

public const string DefaultSelfUpdateUri = "https://apps.0install.net/0install/0install-dotnet.xml"

Field Value

string

DefaultSyncServer

The default value for SyncServer.

public const string DefaultSyncServer = "https://0install.de/sync/"

Field Value

string

Properties

AutoApproveKeys

Automatically approve keys known by the KeyInfoServer and seen the first time a feed is fetched.

public bool AutoApproveKeys { get; set; }

Property Value

bool

EffectiveNetworkUse

Same as NetworkUse, except when there the internet connection is metered (capped at Minimal) or unavailable (capped at Offline).

[Browsable(false)]
public NetworkLevel EffectiveNetworkUse { get; }

Property Value

NetworkLevel

ExternalSolverUri

The feed URI used to get the external solver. Set to empty to deactivate use of external solver.

public FeedUri? ExternalSolverUri { get; set; }

Property Value

FeedUri

FeedMirror

The mirror server used to provide feeds when the original server is unavailable. Set to empty to deactivate use of feed mirror.

public FeedUri? FeedMirror { get; set; }

Property Value

FeedUri

Freshness

The maximum age a cached Feed may have until it is considered stale (needs to be updated).

public TimeSpan Freshness { get; set; }

Property Value

TimeSpan

HelpWithTesting

Always prefer the newest versions, even if they have not been marked as Stable yet.

public bool HelpWithTesting { get; set; }

Property Value

bool

InitialTab

The initial tab to show in GUI representations.

[Browsable(false)]
public ConfigTab InitialTab { get; set; }

Property Value

ConfigTab

IsSyncConfigured

Indicates whether the sync-related configuration is complete.

[Browsable(false)]
public bool IsSyncConfigured { get; }

Property Value

bool

KeyInfoServer

The key information server used to get information about who signed a feed. Set to empty to deactivate use of key information server.

public FeedUri? KeyInfoServer { get; set; }

Property Value

FeedUri

KioskMode

Restrict usage to feeds specified in the catalog.

public bool KioskMode { get; set; }

Property Value

bool

MaxParallelDownloads

Maximum number of Implementations to download in parallel.

[Range(1, 128)]
public int MaxParallelDownloads { get; set; }

Property Value

int

NetworkUse

Controls how liberally network access is attempted.

public NetworkLevel NetworkUse { get; set; }

Property Value

NetworkLevel

SelfUpdateUri

The feed URI used to search for updates for Zero Install itself. Set to empty to deactivate self-update.

public FeedUri? SelfUpdateUri { get; set; }

Property Value

FeedUri

SyncCryptoKey

The local key used to encrypt data before sending it to the SyncServer.

public string SyncCryptoKey { get; set; }

Property Value

string

SyncServer

The sync server used to synchronize your app list between multiple computers.

public FeedUri? SyncServer { get; set; }

Property Value

FeedUri
See Also

SyncServerCredentials

The credentials specified in SyncServerUsername and SyncServerPassword.

[Browsable(false)]
public NetworkCredential? SyncServerCredentials { get; }

Property Value

NetworkCredential

SyncServerKerberos

Always prefer the newest versions, even if they have not been marked as Stable yet.

public bool SyncServerKerberos { get; set; }

Property Value

bool

SyncServerPassword

The password to authenticate with against the SyncServer.

public string SyncServerPassword { get; set; }

Property Value

string
See Also

SyncServerUsername

The username to authenticate with against the SyncServer.

public string SyncServerUsername { get; set; }

Property Value

string
See Also

Methods

Clone()

Creates a deep copy of this Config instance.

public Config Clone()

Returns

Config

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Equals(Config?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Config? other)

Parameters

other Config

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<KeyValuePair<string, string>> GetEnumerator()

Returns

IEnumerator<KeyValuePair<string, string>>

An enumerator that can be used to iterate through the collection.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetOption(string)

Retrieves the string representation of an option identified by a key.

public string GetOption(string key)

Parameters

key string

The key of the option to retrieve.

Returns

string

The string representation of the the option.

Exceptions

KeyNotFoundException

key is invalid.

IsOptionLocked(string)

Determines whether an option is locked by a group policy (in the Windows registry).

public static bool IsOptionLocked(string key)

Parameters

key string

The key of the option to check.

Returns

bool

Load()

Aggregates options from all applicable config files and registry locations.

public static Config Load()

Returns

Config

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 config data.

LoadSafe()

Tries to aggregates options from all applicable config files and registry locations. Automatically falls back to default values on errors.

public static Config LoadSafe()

Returns

Config

The loaded Config or default Config if there was a problem.

ReadFrom(IniData, string)

Reads options from a config file stream and merges them into the config instance.

public void ReadFrom(IniData iniData, string path = "embedded")

Parameters

iniData IniData

The parsed file.

path string

The path of the file iniData was read from. Used for logging.

Exceptions

InvalidDataException

The file contains invalid config values.

ReadFromFile(string)

Reads options from a config file and merges them into the config instance.

public void ReadFromFile(string path)

Parameters

path string

The path of the file to read.

Exceptions

IOException

A problem occurred while reading the file.

UnauthorizedAccessException

Read access to the file is not permitted.

InvalidDataException

The file contains invalid config values.

ReadFromFiles()

Reads options from config files in default locations and merges them into the config instance.

public void ReadFromFiles()

Exceptions

IOException

A problem occurred while reading the file.

UnauthorizedAccessException

Read access to the file is not permitted.

InvalidDataException

The file contains invalid config values.

ReadFromFilesMachineWideOnly()

Reads options from config files in machine-wide locations.

public void ReadFromFilesMachineWideOnly()

Exceptions

IOException

A problem occurred while reading the file.

UnauthorizedAccessException

Read access to the file is not permitted.

InvalidDataException

The file contains invalid config values.

ReadFromGroupPolicy()

Reads options from group policies (in the Windows registry) and merges them into the config instance.

public void ReadFromGroupPolicy()

Exceptions

UnauthorizedAccessException

Read access to the registry key is not permitted.

InvalidDataException

The registry key contains invalid config values.

ResetOption(string)

Resets an option identified by a key to its default value.

public void ResetOption(string key)

Parameters

key string

The key of the option to reset.

Exceptions

KeyNotFoundException

key is invalid.

Save(bool)

Saves the options to a config file in a default location.

public void Save(bool machineWide = false)

Parameters

machineWide bool

true to save in a machine-wide location; false to save in the user profile.

Remarks

This method performs an atomic write operation when possible.

Exceptions

IOException

A problem occurred while writing the file.

UnauthorizedAccessException

Write access to the file is not permitted.

Save(string)

Saves the options to a config file.

public void Save(string path)

Parameters

path string

Remarks

This method performs an atomic write operation when possible.

Exceptions

IOException

A problem occurred while writing the file.

UnauthorizedAccessException

Write access to the file is not permitted.

SetOption(string, string)

Sets an option identified by a key.

public void SetOption(string key, string value)

Parameters

key string

The key of the option to set.

value string

A string representation of the option.

Exceptions

KeyNotFoundException

key is invalid.

FormatException

value is invalid.

UnauthorizedAccessException

This option is controlled by a group policy and can therefore not be modified.

ToIniData()

Converts the options into an in-memory representation of an INI file.

public IniData ToIniData()

Returns

IniData