Fix updater
This commit is contained in:
parent
751c1dc550
commit
50b76223b8
@ -92,6 +92,11 @@ namespace Toolbox
|
||||
version.SaveVersionInfo();
|
||||
}
|
||||
|
||||
ThreadStart t = new ThreadStart(UpdateProgram.CheckLatest);
|
||||
Thread thread = new Thread(t);
|
||||
thread.Start();
|
||||
|
||||
Application.Idle += Application_Idle;
|
||||
|
||||
if (Runtime.UseOpenGL)
|
||||
{
|
||||
|
@ -12,7 +12,7 @@ namespace Toolbox
|
||||
{
|
||||
public class UpdateProgram
|
||||
{
|
||||
static List<Release> Releases;
|
||||
static Release[] releases;
|
||||
public static bool CanUpdate = false;
|
||||
public static bool Downloaded = false;
|
||||
public static Release LatestRelease;
|
||||
@ -28,7 +28,7 @@ namespace Toolbox
|
||||
GetReleases(client).Wait();
|
||||
GetCommits(client).Wait();
|
||||
|
||||
foreach (Release latest in Releases)
|
||||
foreach (Release latest in releases)
|
||||
{
|
||||
Console.WriteLine(
|
||||
"The latest release is tagged at {0} and is named {1} commit {2} date {3}",
|
||||
@ -56,10 +56,6 @@ namespace Toolbox
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Releases.Clear();
|
||||
CommitList.Clear();
|
||||
client = null;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -121,9 +117,10 @@ namespace Toolbox
|
||||
|
||||
static async Task GetReleases(GitHubClient client)
|
||||
{
|
||||
Releases.Clear();
|
||||
List<Release> Releases = new List<Release>();
|
||||
foreach (Release r in await client.Repository.Release.GetAll("KillzXGaming", "Switch-Toolbox"))
|
||||
Releases.Add(r);
|
||||
releases = Releases.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user