elfisa-pharmacy/tools/UpdateCheckSmoke/Program.cs
Exest b69e1b4498 Add forced update check against Gitea releases.
Block startup when a newer Release exists; keep offline pharmacies working.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-31 12:58:36 +03:00

32 lines
1.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using Электроннаяармация.Classes;
namespace UpdateCheckSmoke
{
internal static class Program
{
private static int Main(string[] args)
{
// args: baseUrl repo localVersion
var baseUrl = args.Length > 0 ? args[0] : "http://127.0.0.1:18765";
var repo = args.Length > 1 ? args[1] : "pharmdata/elfisa-pharmacy";
var local = args.Length > 2 ? args[2] : "1.0.3.0";
var result = UpdateChecker.CheckForUpdate(baseUrl, repo, null, local);
Console.WriteLine("CheckedOk=" + result.CheckedOk);
Console.WriteLine("UpdateRequired=" + result.UpdateRequired);
Console.WriteLine("Local=" + result.LocalVersion);
Console.WriteLine("Latest=" + result.LatestVersion);
Console.WriteLine("Download=" + result.DownloadUrl);
Console.WriteLine("Error=" + result.ErrorMessage);
if (!result.CheckedOk)
{
return 2;
}
return result.UpdateRequired ? 0 : 1;
}
}
}