mirror of
https://github.com/Stone-Red-Code/AlwaysUpToDate.git
synced 2026-09-06 15:56:06 +02:00
Migrate update system to XML manifest and improve multi-OS support
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user