1
0
mirror of synced 2024-11-12 02:00:50 +01:00

Updater fixes

This commit is contained in:
KillzXGaming 2024-09-22 14:26:59 -04:00
parent 93f33128d3
commit 44a88b4191

View File

@ -26,6 +26,8 @@ namespace Toolbox
{ {
try try
{ {
VersionCheck versionCheck = new VersionCheck(true);
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
var client = new GitHubClient(new ProductHeaderValue("ST_UpdateTool")); var client = new GitHubClient(new ProductHeaderValue("ST_UpdateTool"));
@ -40,8 +42,8 @@ namespace Toolbox
var asssemblyVersion = Assembly.GetExecutingAssembly().GetName().Version; var asssemblyVersion = Assembly.GetExecutingAssembly().GetName().Version;
var version = string.Concat(asssemblyVersion.ToString().Reverse().Skip(2).Reverse()); var version = string.Concat(asssemblyVersion.ToString().Reverse().Skip(2).Reverse());
var lastestRelease = Releases.FirstOrDefault(x => x.Name.Contains($"v{version}")); var lastestRelease = Releases.FirstOrDefault();
if (lastestRelease != null) if (lastestRelease != null && lastestRelease.Assets[0].UpdatedAt.ToString() == versionCheck.CompileDate)
{ {
Runtime.ProgramVersion = lastestRelease.TagName; Runtime.ProgramVersion = lastestRelease.TagName;
Runtime.CompileDate = lastestRelease.Assets[0].UpdatedAt.ToString(); Runtime.CompileDate = lastestRelease.Assets[0].UpdatedAt.ToString();