Migrate update system to XML manifest and improve multi-OS support

This commit is contained in:
Stone_Red
2026-02-20 20:05:33 +01:00
parent e7102ab0b3
commit dd0d24cf47
5 changed files with 278 additions and 129 deletions
+47 -7
View File
@@ -1,14 +1,54 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Generic;
using System.Xml.Serialization;
namespace AlwaysUpToDate
{
internal class UpdateInfo
[XmlRoot("updates")]
public class UpdateManifest
{
[XmlElement("item")]
public List<UpdateItem> Items { get; set; } = new List<UpdateItem>();
}
public class UpdateItem
{
[XmlElement("os")]
public TargetOS OS { get; set; }
[XmlElement("version")]
public string Version { get; set; }
public string FileUrl { get; set; }
public string AdditionalInformation { get; set; }
public bool Mandatory { get; set; }
[XmlElement("url")]
public string DownloadUrl { get; set; }
[XmlElement("changelog")]
public string ChangelogUrl { get; set; }
[XmlElement("mandatory")]
public bool IsMandatory { get; set; }
[XmlElement("checksum")]
public Checksum Checksum { get; set; }
}
public class Checksum
{
[XmlAttribute("algorithm")]
public string Algorithm { get; set; }
[XmlText]
public string Value { get; set; }
}
public enum TargetOS
{
[XmlEnum("windows")]
Windows,
[XmlEnum("macos")]
MacOS,
[XmlEnum("linux")]
Linux,
}
}