Saltar al contenido principal

SimpleFileSource class

Namespace: Velopack.Sources

Retrieves available updates from a local or network-attached disk. The directory must contain one or more valid packages, as well as a 'releases.{channel}.json' index file.

public class SimpleFileSource : IUpdateSource

Implements: IUpdateSource

Constructors

ConstructorSummary
SimpleFileSourceRetrieves available updates from a local or network-attached disk. The directory

SimpleFileSource(baseDirectory)

public SimpleFileSource(DirectoryInfo baseDirectory)

Retrieves available updates from a local or network-attached disk. The directory must contain one or more valid packages, as well as a 'releases.{channel}.json' index file.

Parameters

NameTypeDescription
baseDirectoryDirectoryInfo

Properties

PropertySummary
BaseDirectoryThe local directory containing packages to update to.

BaseDirectory

public virtual DirectoryInfo BaseDirectory { get; }

The local directory containing packages to update to.

Methods

MethodSummary
GetReleaseFeedRetrieve the list of available remote releases from the package source. These releases
DownloadReleaseEntryDownload the specified VelopackAsset to the provided local file path.

GetReleaseFeed(logger, appId, channel, stagingId, latestLocalRelease)

public virtual Task<VelopackAssetFeed> GetReleaseFeed(IVelopackLogger logger, string? appId, string channel, Guid? stagingId = null, VelopackAsset? latestLocalRelease = null)

Retrieve the list of available remote releases from the package source. These releases can subsequently be downloaded with DownloadReleaseEntry.

Parameters

NameTypeDescription
loggerIVelopackLoggerThe logger to use for any diagnostic messages.
appIdstring
channelstringRelease channel to filter packages by. Can be null, which is the
default channel for this operating system.
stagingIdGuid?A persistent user-id, used for calculating whether a specific
release should be available to this user or not. (eg, for the purposes of rolling out
an update to only a small portion of users at a time).
latestLocalReleaseVelopackAssetThe latest / current local release. If specified,
metadata from this package may be provided to the remote server (such as package id,
or cpu architecture) to ensure that the correct package is downloaded for this user.

Returns Task<VelopackAssetFeed> — An array of VelopackAsset objects that are available for download and are applicable to this user.

DownloadReleaseEntry(logger, releaseEntry, localFile, progress, cancelToken)

public virtual Task DownloadReleaseEntry(IVelopackLogger logger, VelopackAsset releaseEntry, string localFile, Action<int> progress, CancellationToken cancelToken)

Download the specified VelopackAsset to the provided local file path.

Parameters

NameTypeDescription
loggerIVelopackLoggerThe logger to use for any diagnostic messages.
releaseEntryVelopackAssetThe release to download.
localFilestringThe path on the local disk to store the file. If this file exists,
it will be overwritten.
progressAction<int>This delegate will be executed with values from 0-100 as the
download is being processed.
cancelTokenCancellationTokenA token to use to cancel the request.

Returns Task


Generated from Velopack 1.1.1