Working Configuration
This commit is contained in:
33
FakeeDeck/Class/AutoUpdateHelper.cs
Normal file
33
FakeeDeck/Class/AutoUpdateHelper.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using AutoUpdaterDotNET;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Net.Http.Json;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FakeeDeck.Class
|
||||
{
|
||||
internal class AutoUpdateHelper
|
||||
{
|
||||
public AutoUpdateHelper() {
|
||||
AutoUpdater.ParseUpdateInfoEvent += AutoUpdaterOnParseUpdateInfoEvent;
|
||||
AutoUpdater.Synchronous = true;
|
||||
AutoUpdater.ShowRemindLaterButton = false;
|
||||
AutoUpdater.Start("https://github.com/GamerClassN7/FakeDeck/releases/latest/download/meta.xml");
|
||||
}
|
||||
private void AutoUpdaterOnParseUpdateInfoEvent(ParseUpdateInfoEventArgs args)
|
||||
{
|
||||
JsonElement json = JsonDocument.Parse(args.RemoteData).RootElement;
|
||||
args.UpdateInfo = new UpdateInfoEventArgs
|
||||
{
|
||||
CurrentVersion = json.GetProperty("tag_name").ToString().TrimStart('v'),
|
||||
DownloadURL = json.GetProperty("zipball_url").ToString(),
|
||||
};
|
||||
|
||||
Debug.WriteLine(json.ToString());
|
||||
}
|
||||
}
|
||||
}
|
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
@@ -12,6 +12,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Autoupdater.NET.Official" Version="1.9.2" />
|
||||
<PackageReference Include="YamlDotNet" Version="16.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@@ -2,6 +2,8 @@
|
||||
using FakeeDeck.Class;
|
||||
using System.Diagnostics;
|
||||
using System.Text.Json;
|
||||
using AutoUpdaterDotNET;
|
||||
|
||||
|
||||
AutoUpdateHelper updater = new AutoUpdateHelper();
|
||||
FakeDeck fakeDeck = new FakeDeck();
|
Reference in New Issue
Block a user