Updatum is a lightweight, cross-platform C# library distributed as a NuGet package. It automates application updates using GitHub Releases — checking for new versions, retrieving changelogs, downloading assets with progress tracking, and auto-upgrading the running application across Windows, Linux, and macOS.
Key facts:
- Repository: https://github.com/sn4k3/Updatum
- Author: Tiago Conceição (PTRTECH)
- License: MIT
- Version: centrally defined in
Directory.Build.props(<Version>element) - Multi-target: net8.0, net9.0, net10.0
- Only NuGet dependency: Octokit (GitHub API client)
| Path | Description |
|---|---|
Updatum.slnx |
Solution file (XML-based slnx format) |
Directory.Build.props |
Shared version, metadata, signing, build configuration |
Updatum/Updatum.csproj |
Library project — multi-targets net8.0/net9.0/net10.0 |
Updatum/UpdatumManager.cs |
Core class (~2300 lines) — update check, download, install |
Updatum/EntryApplication.cs |
Static utility (~760 lines) — assembly info, OS/runtime/bundle detection |
Updatum/UpdatumDownloadedAsset.cs |
Record wrapping downloaded asset metadata |
Updatum/UpdatumEnums.cs |
Enums: UpdatumState, UpdatumWindowsExeType, UpdatumSingleFileExecutableNameStrategy |
Updatum/Extensions/ArchiveExtensions.cs |
ZIP extraction helpers |
Updatum/Extensions/GitHubExtensions.cs |
Octokit Release extension methods |
Updatum/Extensions/Utilities.cs |
Process launch, temp folders, installer detection, script escaping |
Updatum.FakeApp/Program.cs |
Complete usage example (console app targeting sn4k3/UVtools) |
.github/workflows/dotnet.yml |
CI: build + test on push/PR to main |
.github/workflows/release.yml |
Publish: pack → tag → NuGet push → GitHub Release |
CHANGELOG.md |
Version history — must be updated with each release |
dotnet restore # Restore dependencies
dotnet build # Build the solution
dotnet test # Run tests (currently no test project)
dotnet pack Updatum --configuration Release --output . # Create NuGet package
dotnet run --project Updatum.FakeApp # Run example appImplements INotifyPropertyChanged and IDisposable. Uses Octokit's GitHubClient for API calls and a static HttpClient for downloads. Supports SynchronizationContext dispatching for UI thread events.
Lifecycle flow:
CheckForUpdatesAsync()— fetches releases, filters by version/platform/pre-release, populatesReleasesAheadGetChangelog()— formats markdown changelog fromReleasesAheadDownloadUpdateAsync()— downloads the compatible asset to a temp folder with progress reportingInstallUpdateAsync()— handles zip extraction, single-file replacement, installer execution, or macOS bundle upgrade; creates platform-specific upgrade scripts (batch for Windows, bash for Linux/macOS) and terminates the process
Key events: CheckForUpdateCompleted, UpdateFound, DownloadCompleted, InstallUpdateCompleted (fired before process kill — use for saving state)
Static utility class with lazily cached properties for: assembly info, executable paths, OS detection, runtime identifiers, bundle type detection (AppImage, Flatpak, macOS bundle, .NET single-file).
- Windows: Batch (
.bat) — usesUtilities.BatchSetValue()for safe escaping - Linux/macOS: Bash — uses
Utilities.BashAnsiCString()for ANSI-C quoting - macOS: Optional local codesigning with
codesign --force --deep -s - - Linux AppImage: Move + rename +
chmod 755
- C# latest with nullable reference types enabled
- File-scoped namespaces:
namespace Updatum; - XML doc comments (
///) on all public members — documentation file is generated ConfigureAwait(false)on everyawaitin library codeINotifyPropertyChangedviaRaiseAndSetIfChanged(ref _field, value)for bindable properties#regionblocks for code organization: Events, Constants, Properties, Constructor, Methods
- Properties, methods, constants:
PascalCase - Private fields:
_camelCaseprefix - Follow existing code patterns (see
CONTRIBUTING.md)
ArgumentException/ArgumentNullException→ invalid method parametersInvalidOperationException→ invalid object state (NEVER useArgumentOutOfRangeExceptionfor property-level validation)OperationCanceledException→ cancelled async operations
- Installer signature detection uses XOR-obfuscated byte arrays to prevent false positives in single-file apps — never add raw installer keyword strings to the codebase
Utilitiesclass ispublicunder#if DEBUG,internalin Release — used for testability
| Package | Version | Purpose |
|---|---|---|
Octokit |
14.0.0 | GitHub API client for release fetching |
Microsoft.SourceLink.GitHub |
10.0.103 | Source Link for debugger integration |
The library intentionally has minimal dependencies.
- Update
<Version>inDirectory.Build.props - Add a new entry to
CHANGELOG.md - Trigger the
release.ymlGitHub Actions workflow (manual dispatch):- Packs the NuGet package
- Creates a Git tag
- Pushes to nuget.org and GitHub Packages
- Creates a GitHub Release with the changelog body
- Supports dry-run mode