mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 04:23:09 +00:00
Updater fixes
This commit is contained in:
parent
93f33128d3
commit
44a88b4191
1 changed files with 4 additions and 2 deletions
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue