Files
poli0981andClaude Opus 5.5 f29d53de80 docs: refresh screenshots for 1.2.0; LegacyClient can check the live feed
- Screenshots rendered from the real app (Avalonia headless with Skia),
  replacing the 1.1 ones that still showed removed features.
- LegacyClient accepts the repository URL instead of a folder, so the
  published release can be checked with Velopack 0.0.1298 against GitHub.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 13:16:40 +07:00

54 lines
2.3 KiB
C#

using System;
using System.IO;
using Velopack;
using Velopack.Locators;
using Velopack.Sources;
// Usage: LegacyClient <releases> <channel> <installed-version> <expected-version> <root-dir> <app-dir> <update-exe> <packages-dir>
//
// Uses Velopack 0.0.1298 - the library inside Hash Tool 1.1.x - to read a release feed, pick the update and download it
// with its checksum checks, exactly as an installed 1.1.x copy would. <releases> is a folder of freshly packed files
// (the release workflow's upgrade gate) or the repository URL, to check what is really published on GitHub.
// Prints the downloaded package path; the caller then lets the old updater apply it and smoke-tests the result.
if (args.Length != 8)
{
Console.Error.WriteLine("usage: LegacyClient <releases-dir|github-url> <channel> <installed-version> <expected-version> <root-dir> <app-dir> <update-exe> <packages-dir>");
return 2;
}
var (releases, channel, installed, expected, root, app, updateExe, packages) =
(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
Directory.CreateDirectory(packages);
IUpdateSource source = releases.StartsWith("https://", StringComparison.OrdinalIgnoreCase)
? new GithubSource(releases, null, false)
: new SimpleFileSource(new DirectoryInfo(releases));
var locator = new TestVelopackLocator("HashTool", installed, packages, app, root, updateExe, channel);
var manager = new UpdateManager(source, new UpdateOptions { ExplicitChannel = channel }, locator);
var update = manager.CheckForUpdates();
if (update is null)
{
Console.Error.WriteLine($"Velopack 0.0.1298 found no update for {installed} on channel '{channel}' in {releases}.");
return 1;
}
var found = update.TargetFullRelease.Version.ToString();
if (!string.Equals(found, expected, StringComparison.Ordinal))
{
Console.Error.WriteLine($"Velopack 0.0.1298 offered {found}, expected {expected}.");
return 1;
}
manager.DownloadUpdates(update);
var package = Path.Combine(packages, update.TargetFullRelease.FileName);
if (!File.Exists(package))
{
Console.Error.WriteLine($"The downloaded package is missing: {package}");
return 1;
}
Console.Error.WriteLine($"Velopack 0.0.1298 downloaded and verified {update.TargetFullRelease.FileName} ({found}).");
Console.WriteLine(package);
return 0;