Table of Contents

Class AutoUpdater

Namespace
The.WPF.Shell
Assembly
Instagile.WPF.dll

Updates applications in-place. Delta-based updates are built in a temporary directory, then launched to install themselves over the original program.

public class AutoUpdater
Inheritance
AutoUpdater
Inherited Members

Constructors

AutoUpdater(IHttpClientFactory, ILogger<AutoUpdater>, UpdateOptions?)

public AutoUpdater(IHttpClientFactory clientFactory, ILogger<AutoUpdater> logger, UpdateOptions? options = null)

Parameters

clientFactory IHttpClientFactory

An instance of IHttpClientFactory, with a BaseAddress set to the URL of an API server running MapTheFramework()

logger ILogger<AutoUpdater>

Required logger - debugging failed updates without logs is not something you want to do.

options UpdateOptions

Update process configuration

AutoUpdater(IHttpClientFactory, string, ILogger<AutoUpdater>, UpdateOptions?)

public AutoUpdater(IHttpClientFactory clientFactory, string address, ILogger<AutoUpdater> logger, UpdateOptions? options = null)

Parameters

clientFactory IHttpClientFactory

An instance of IHttpClientFactory.

address string

URL of an API server running MapTheFramework(), relative to the BaseAddress of factory-created HttpClients or absolute if they have no base.

logger ILogger<AutoUpdater>

Required logger - debugging failed updates without logs is not something you want to do.

options UpdateOptions

Update process configuration

AutoUpdater(IHttpClientFactory, Uri, ILogger<AutoUpdater>, UpdateOptions?)

public AutoUpdater(IHttpClientFactory clientFactory, Uri address, ILogger<AutoUpdater> logger, UpdateOptions? options = null)

Parameters

clientFactory IHttpClientFactory

An instance of IHttpClientFactory.

address Uri

URL of an API server running MapTheFramework(), relative to the BaseAddress of factory-created HttpClients or absolute if they have no base.

logger ILogger<AutoUpdater>

Required logger - debugging failed updates without logs is not something you want to do.

options UpdateOptions

Update process configuration

AutoUpdater(string, ILogger<AutoUpdater>, UpdateOptions?)

public AutoUpdater(string address, ILogger<AutoUpdater> logger, UpdateOptions? options = null)

Parameters

address string

URL of an API server running MapTheFramework(). Must be absolute.

logger ILogger<AutoUpdater>

Required logger - debugging failed updates without logs is not something you want to do.

options UpdateOptions

Update process configuration

AutoUpdater(Uri, ILogger<AutoUpdater>, UpdateOptions?)

public AutoUpdater(Uri address, ILogger<AutoUpdater> logger, UpdateOptions? options = null)

Parameters

address Uri

URL of an API server running MapTheFramework(). Must be absolute.

logger ILogger<AutoUpdater>

Required logger - debugging failed updates without logs is not something you want to do.

options UpdateOptions

Update process configuration

Methods

CheckForUpdate(string, IProgress<string>?, CancellationToken)

returns an updated version if one is found - this may be an upgrade or a downgrade, it's up to the server

public Task<Optional<Deployment>> CheckForUpdate(string currentVersion, IProgress<string>? progress = null, CancellationToken cancellationToken = default)

Parameters

currentVersion string
progress IProgress<string>
cancellationToken CancellationToken

Returns

Task<Optional<Deployment>>

DefaultHttpConfig(HttpClient)

public static void DefaultHttpConfig(HttpClient client)

Parameters

client HttpClient

DownloadOrInstall(IProgress<string>?, CancellationToken)

checks for an update to download or, if one has already been downloaded, installs it

public Task DownloadOrInstall(IProgress<string>? progress = null, CancellationToken cancellationToken = default)

Parameters

progress IProgress<string>
cancellationToken CancellationToken

Returns

Task

DownloadUpdate(Deployment, string, IProgress<string>?, CancellationToken)

download and extract a specified update

public Task<string?> DownloadUpdate(Deployment updateInfo, string currentExe, IProgress<string>? progress = null, CancellationToken cancellationToken = default)

Parameters

updateInfo Deployment
currentExe string
progress IProgress<string>
cancellationToken CancellationToken

Returns

Task<string>

InstallSelfAsUpdate(string, int?, IProgress<string>?, CancellationToken)

runs in the new client to replace the old version

public Task InstallSelfAsUpdate(string originalDirectory, int? oldProcessId, IProgress<string>? progress = null, CancellationToken cancellationToken = default)

Parameters

originalDirectory string
oldProcessId int?
progress IProgress<string>
cancellationToken CancellationToken

Returns

Task