From 44a88b4191bc7bfe797ae979653f845825271b67 Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Sun, 22 Sep 2024 14:26:59 -0400 Subject: [PATCH] Updater fixes --- Toolbox/UpdateProgram.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Toolbox/UpdateProgram.cs b/Toolbox/UpdateProgram.cs index 0c56ebb7..b35a8a91 100644 --- a/Toolbox/UpdateProgram.cs +++ b/Toolbox/UpdateProgram.cs @@ -26,6 +26,8 @@ namespace Toolbox { try { + VersionCheck versionCheck = new VersionCheck(true); + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; var client = new GitHubClient(new ProductHeaderValue("ST_UpdateTool")); @@ -40,8 +42,8 @@ namespace Toolbox var asssemblyVersion = Assembly.GetExecutingAssembly().GetName().Version; var version = string.Concat(asssemblyVersion.ToString().Reverse().Skip(2).Reverse()); - var lastestRelease = Releases.FirstOrDefault(x => x.Name.Contains($"v{version}")); - if (lastestRelease != null) + var lastestRelease = Releases.FirstOrDefault(); + if (lastestRelease != null && lastestRelease.Assets[0].UpdatedAt.ToString() == versionCheck.CompileDate) { Runtime.ProgramVersion = lastestRelease.TagName; Runtime.CompileDate = lastestRelease.Assets[0].UpdatedAt.ToString();