SnkUpdateMaster.Core
2.1.0
dotnet add package SnkUpdateMaster.Core --version 2.1.0
NuGet\Install-Package SnkUpdateMaster.Core -Version 2.1.0
<PackageReference Include="SnkUpdateMaster.Core" Version="2.1.0" />
<PackageVersion Include="SnkUpdateMaster.Core" Version="2.1.0" />
<PackageReference Include="SnkUpdateMaster.Core" />
paket add SnkUpdateMaster.Core --version 2.1.0
#r "nuget: SnkUpdateMaster.Core, 2.1.0"
#:package SnkUpdateMaster.Core@2.1.0
#addin nuget:?package=SnkUpdateMaster.Core&version=2.1.0
#tool nuget:?package=SnkUpdateMaster.Core&version=2.1.0
SnkUpdateMaster.Core
Purpose: the base module with business logic, interfaces, and ready-made implementations for the update pipeline.
Typical usage
Key interfaces:
IUpdateInfoProvider- fetches information about the available update.IUpdateDownloader- downloads the update file.IInstaller- applies the downloaded file to the application.IIntegrityVerifier- validates the checksum before installation.ICurrentVersionManager- reads and updates the current application version.
Built-in implementations:
IInstaller- Installs downloaded updates:ZipInstaller- Unpacks update files from a ZIP archive. Used by calling theWithZipInstallermethod.
IIntegrityVerifier- Verifies file integrity by comparing checksums:ShaIntegrityVerifier- Verifies file integrity using the SHA-256 algorithm. Used by calling theWithSha256IntegrityVerifiermethod.
ICurrentVersionManager- Manages the currently installed application version:FileVersionManager- Stores the version in a text file. The version format ismajor.minor.build. Used by calling theWithFileCurrentVersionManagermethod.
Use UpdateManager to orchestrate download and installation. Build it via UpdateManagerBuilder:
var updateManager = new UpdateManagerBuilder()
.WithZipInstaller("path to app folder")
.WithFileCurrentVersionManager()
.WithSha256IntegrityVerifier()
.RegisterInstance<IUpdateInfoProvider>(customProviderInstance)
.RegisterFactory<IUpdateDownloader>(customDownloaderFactory)
.Build();
The RegisterInstance<T> and RegisterFactory<T> methods allow you to add the required dependencies to the builder as a instance object or as a factory method.
Check for updates and install:
var updated = await updateManager.CheckAndInstallUpdatesAsync(progress);
💡 Besides the built-ins, you can register custom interface implementations via
AddDependencyand mix them with provided components.
Logging
By default, if the ILoggerFactory isn't registered, NullLogger is used and no messages are output. To enable logging, register the logger factory by calling the WithLogger method in the builder:
var updateManager = new UpdateManagerBuilder()
.WithLogger(loggerFactory)
.WithZipInstaller("path to app folder")
.WithFileCurrentVersionManager()
.WithSha256IntegrityVerifier()
.RegisterInstance<IUpdateInfoProvider>(customProviderInstance)
.RegisterFactory<IUpdateDownloader>(customDownloaderFactory)
.Build();
This factory is used to create ILogger in UpdateManager, as well as in IUpdateInfoProvider and IUpdateDownloader implementations from other modules, such as Ftp and SqlServer.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.1)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on SnkUpdateMaster.Core:
| Package | Downloads |
|---|---|
|
SnkUpdateMaster.Ftp
Module that retrieves update metadata and archives via FTP/SFTP. |
|
|
SnkUpdateMaster.SqlServer
Extensions that fetch update metadata and files directly from Microsoft SQL Server. |
|
|
SnkUpdateMaster.FileSystem
A module that reads metadata and files updated from the local file system. |
|
|
SnkUpdateMaster.Http
Module that retrieves update metadata and archives via HTTP/HTTPS. |
GitHub repositories
This package is not used by any popular GitHub repositories.