Use GitHub API for dev build download

This commit is contained in:
Jaex 2022-09-19 15:17:50 +03:00
parent ad3b492836
commit 6e639b0e92
2 changed files with 18 additions and 2 deletions

View file

@ -455,7 +455,7 @@ private async void btnCheckDevBuild_Click(object sender, EventArgs e)
if (MessageBox.Show(Resources.ApplicationSettingsForm_btnCheckDevBuild_Click_DevBuilds_Warning, "ShareX",
MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
{
await TaskHelpers.DownloadAppVeyorBuild();
await TaskHelpers.DownloadDevBuild();
}
if (!IsDisposed)

View file

@ -1863,11 +1863,27 @@ public static void ToggleActionsToolbar()
}
}
public static async Task DownloadDevBuild()
{
GitHubUpdateChecker updateChecker = new GitHubUpdateChecker("ShareX", "DevBuilds")
{
IsBeta = true,
IsPortable = Program.Portable
};
await updateChecker.CheckUpdateAsync();
if (updateChecker.Status == UpdateStatus.UpdateAvailable)
{
updateChecker.DownloadUpdate();
}
}
public static async Task DownloadAppVeyorBuild()
{
AppVeyorUpdateChecker updateChecker = new AppVeyorUpdateChecker()
{
IsBeta = Program.Dev,
IsBeta = true,
IsPortable = Program.Portable,
Branch = "develop"
};