* feat(app): Velopack, the updater with FR-12 as its shape, release.yml, and one VERSION source (P4 PR-5)
The updater of 11_UPDATER behind an IUpdateClient port (VelopackUpdateClient over Velopack 1.2.0's
GitHub source; stable = releases GitHub does not mark pre-release, beta adds them): the startup silent
check 5 s after start for an installed copy with update.auto_check on, Help > Check for updates with
the dialogs and the six error rows, the background download (a checksum failure retried once), and the
apply -- refused while any session runs, Deferred until the last SessionCompleted, then Shutdown to the
Agent, the connection's relaunch held, the pipe watched until it drops, WaitExitThenApplyUpdates, the
host ended. Program.Main runs VelopackApp first; the uninstall hook stops the Agent, unregisters the
layer, removes the logon task and asks about the data folder.
The package id is FrameLedger.App, not FrameLedger: Velopack installs into and deletes
%LOCALAPPDATA%\<packId>, which with the documented id is the data folder holding ledger.db.
VERSION at the root feeds Directory.Build.props and the native CMake project; versioninfo-check
compares every binary against it. release.yml gates the tag against VERSION and CHANGELOG
(tools/release-notes.ps1), substitutes {{RELEASE_DATE}}, runs the identical gate, publishes, asserts
the published tree, packs, checksums and releases.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(app): the private constant's name, Velopack's copyright as its package states it, and the measured pack
- UpdateService: _idleState (IDE1006, the repository's private-field rule; dotnet format caught it).
- legal/licenses/velopack-MIT.txt and THIRD_PARTY_NOTICES: the copyright line is the package's own
<copyright> field ("Velopack Ltd."), not a name written from memory.
- 12_BUILD / 13_CI_CD / CHANGELOG: vpk pack 1.2.0 run by hand over the published tree -- Setup 104 MB,
VelopackApp.Run() verified in Program.Main.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
51 lines
1.7 KiB
C#
51 lines
1.7 KiB
C#
using FrameLedger.App.Update;
|
|
|
|
namespace FrameLedger.App.Tests.Update;
|
|
|
|
/// <summary>An <see cref="IUpdateClient"/> a test scripts: what the next check finds, what each step throws, and what was asked of it.</summary>
|
|
internal sealed class FakeUpdateClient : IUpdateClient
|
|
{
|
|
public bool IsInstalled { get; set; } = true;
|
|
|
|
public string? CurrentVersion { get; set; } = "0.1.0";
|
|
|
|
/// <summary>What the next check returns; null is "current".</summary>
|
|
public UpdateCandidate? Next { get; set; }
|
|
|
|
public UpdateException? CheckThrows { get; set; }
|
|
|
|
/// <summary>One failure per download attempt, in order; an empty queue downloads.</summary>
|
|
public Queue<UpdateException> DownloadThrows { get; } = new();
|
|
|
|
public int DownloadAttempts { get; private set; }
|
|
|
|
/// <summary>The <c>includePrereleases</c> flag of every check, in order.</summary>
|
|
public List<bool> Checks { get; } = [];
|
|
|
|
public List<string> Downloaded { get; } = [];
|
|
|
|
public List<string> Applied { get; } = [];
|
|
|
|
public Task<UpdateCandidate?> CheckAsync(bool includePrereleases, CancellationToken ct = default)
|
|
{
|
|
Checks.Add(includePrereleases);
|
|
return CheckThrows is { } ex ? Task.FromException<UpdateCandidate?>(ex) : Task.FromResult(Next);
|
|
}
|
|
|
|
public Task DownloadAsync(UpdateCandidate candidate, IProgress<int>? progress, CancellationToken ct = default)
|
|
{
|
|
DownloadAttempts++;
|
|
if (DownloadThrows.TryDequeue(out UpdateException? ex))
|
|
{
|
|
return Task.FromException(ex);
|
|
}
|
|
|
|
progress?.Report(50);
|
|
progress?.Report(100);
|
|
Downloaded.Add(candidate.Version);
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
public void ApplyOnExit(UpdateCandidate candidate) => Applied.Add(candidate.Version);
|
|
}
|