Zongsoft.Upgrading.Upgrader
0.1.0
dotnet add package Zongsoft.Upgrading.Upgrader --version 0.1.0
NuGet\Install-Package Zongsoft.Upgrading.Upgrader -Version 0.1.0
<PackageReference Include="Zongsoft.Upgrading.Upgrader" Version="0.1.0" />
<PackageVersion Include="Zongsoft.Upgrading.Upgrader" Version="0.1.0" />
<PackageReference Include="Zongsoft.Upgrading.Upgrader" />
paket add Zongsoft.Upgrading.Upgrader --version 0.1.0
#r "nuget: Zongsoft.Upgrading.Upgrader, 0.1.0"
#:package Zongsoft.Upgrading.Upgrader@0.1.0
#addin nuget:?package=Zongsoft.Upgrading.Upgrader&version=0.1.0
#tool nuget:?package=Zongsoft.Upgrading.Upgrader&version=0.1.0
Zongsoft.Upgrading.Upgrader
Overview
Zongsoft.Upgrading.Upgrader is the client-side automatic upgrader for the Zongsoft framework.
After it is loaded into a Zongsoft host application, it periodically checks configured release channels, downloads matching packages, extracts them, creates the deployment descriptor, starts the deployer executable, and then shuts down the current application so deployment can continue outside the locked process.
Responsibilities
- Resolve the current application identity: name, edition, version, platform, architecture, application path, and application type.
- Discover candidate releases from the configured
FileorWebchannel. - Select full and delta releases newer than the current version and not newer than an optional target version.
- Download release packages into a temporary application-specific directory.
- Verify package size and checksum before deployment.
- Extract packages into a temporary
.appdirectory. - Write the
.deploymentdeployment descriptor into the application directory. - Start
Zongsoft.Upgrading.Deployerand stop the current host process.
Installation
Install the NuGet package into the application that should upgrade itself:
dotnet add package Zongsoft.Upgrading.Upgrader
The package also contains the plugin and option artifacts used by Zongsoft plugin hosting:
Zongsoft.Upgrading.Upgrader.pluginZongsoft.Upgrading.Upgrader.optionZongsoft.Upgrading.Upgrader.deploy
Configuration
The default option file declares two connection settings under /Upgrading:
<options>
<option path="/Upgrading">
<connectionSettings default="File">
<connectionSetting connectionSetting.name="Web"
value="url=http://127.0.0.1:8069/Upgrading/Upgrader;timeout=30s" />
<connectionSetting connectionSetting.name="File"
value="url=zfs.s3:/upgrading/releases/" />
</connectionSettings>
</option>
</options>
| Setting | Description |
|---|---|
default |
The channel used when Upgrader.UpgradeAsync() is called without an explicit channel. |
Web:url |
Base URL of the Web package manager discovery endpoint. |
Web:timeout |
HTTP timeout. Values such as 30s are parsed by Zongsoft time-span utilities. |
File:url |
Root file-system URL containing release manifests and package files. |
Plugin Startup
The packaged plugin registers an Upgrader worker under /Workbench/Startup:
<extension path="/Workbench/Startup">
<object name="Upgrader" period="10m" type="Zongsoft.Upgrading.Upgrader, Zongsoft.Upgrading.Upgrader" />
</extension>
The worker checks for upgrades every period. If the period is five minutes or longer, it also schedules one short-delay check about ten seconds after startup.
Manual Usage
Applications can invoke the upgrader directly:
using Zongsoft.Upgrading;
if(await Upgrader.UpgradeAsync("Web", cancellationToken))
Upgrader.Deploy();
UpgradeAsync returns true when an upgrade was prepared successfully or when a deployment descriptor already exists and is waiting to be deployed.
Channel Behavior
File Channel
The File channel scans the configured root URL in this order:
{root}/{application-name}/*.manifest{root}/{application-type}/{application-name}/*.manifest{root}/{application-type}/{application-name}*.manifest{root}/{application-name}*.manifest
For each manifest, it resolves the package path relative to the manifest location and stores the resolved download URL in release properties.
Web Channel
The Web channel calls:
{base-url}/{application-name}/{edition}?Name=...&Edition=...&Platform=...&Architecture=...&CurrentlyVersion=...
The request also includes hardware fingerprint information that server-side evaluators can use to decide whether a release is suitable for a specific instance.
Release Selection
The upgrader only accepts releases that match:
- application name;
- platform;
- architecture;
- edition, when specified;
- version greater than the current application version;
- optional target version, when specified.
When a full release is available, the newest full release is selected as the trunk and only delta releases newer than that trunk are applied. If no full release is selected, matching delta releases are applied in ascending version order.
Deployment Hand-Off
The deployer executable must be available at:
{application-path}/.deployer/Zongsoft.Upgrading.Deployer
On Windows the executable is Zongsoft.Upgrading.Deployer.exe. On Linux, the upgrader starts the deployer with systemd-run so it can continue after the application process exits.
The upgrader passes the deployer these key arguments:
| Argument | Description |
|---|---|
site |
Site identifier from application configuration. |
app.id |
Current process id. |
app.name |
Current application name. |
app.type |
Application type, such as Web, Daemon, or Terminal. |
app.path |
Application root directory. |
host.path |
Current host executable path. |
host.args#n |
Original host command-line arguments. |
daemon |
Optional service name used by deployer restart logic. |
deployment |
Full path of the .deployment descriptor file. |
Executors
The upgrader registers the built-in executor commands:
CopyMoveLinkDelete
Executors are declared in the release manifest and are later invoked by the deployer during Deploying and Deployed.
Notes
- The upgrade package should include a deployer executable compatible with the target platform.
- Full releases clean the application directory during deployment; keep persistent data, logs, and configuration outside the files replaced by the upgrade package or exclude them from the package.
- The running host must be able to shut down cleanly within the upgrader shutdown timeout.
License
This project is licensed under the MIT license.
| 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 is compatible. 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 is compatible. 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. |
-
net10.0
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0)
- Zongsoft.Core (>= 7.63.0)
-
net8.0
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Zongsoft.Core (>= 7.63.0)
-
net9.0
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.2)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.2)
- Zongsoft.Core (>= 7.63.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 76 | 10/10/2026 |