diff --git a/ShareX.HelpersLib/ShareX.HelpersLib.csproj b/ShareX.HelpersLib/ShareX.HelpersLib.csproj
index 7bb015654..f9d2d2394 100644
--- a/ShareX.HelpersLib/ShareX.HelpersLib.csproj
+++ b/ShareX.HelpersLib/ShareX.HelpersLib.csproj
@@ -350,6 +350,8 @@
+
+
diff --git a/ShareX.HelpersLib/UpdateChecker/AppVeyor.cs b/ShareX.HelpersLib/UpdateChecker/AppVeyor.cs
new file mode 100644
index 000000000..03ab0832e
--- /dev/null
+++ b/ShareX.HelpersLib/UpdateChecker/AppVeyor.cs
@@ -0,0 +1,124 @@
+#region License Information (GPL v3)
+
+/*
+ ShareX - A program that allows you to take screenshots and share any file type
+ Copyright (c) 2007-2017 ShareX Team
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ Optionally you can also view the license at .
+*/
+
+#endregion License Information (GPL v3)
+
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Cache;
+using System.Text;
+
+namespace ShareX.HelpersLib
+{
+ public class AppVeyor
+ {
+ public string AccountName { get; set; }
+ public string ProjectSlug { get; set; }
+ public IWebProxy Proxy { get; set; }
+
+ private const string APIURL = "https://ci.appveyor.com/api";
+
+ public AppVeyorProject GetProjectByBranch(string branch = "master")
+ {
+ string url = $"{APIURL}/projects/{AccountName}/{ProjectSlug}/branch/{branch}";
+
+ using (WebClient wc = new WebClient())
+ {
+ wc.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);
+ wc.Headers.Add(HttpRequestHeader.UserAgent, ShareXResources.UserAgent);
+ wc.Proxy = Proxy;
+
+ string response = wc.DownloadString(url);
+
+ if (!string.IsNullOrEmpty(response))
+ {
+ return JsonConvert.DeserializeObject(response);
+ }
+ }
+
+ return null;
+ }
+
+ public AppVeyorProjectArtifact[] GetArtifacts(string jobId)
+ {
+ string url = $"{APIURL}/buildjobs/{jobId}/artifacts";
+
+ using (WebClient wc = new WebClient())
+ {
+ wc.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);
+ wc.Headers.Add(HttpRequestHeader.UserAgent, ShareXResources.UserAgent);
+ wc.Proxy = Proxy;
+
+ string response = wc.DownloadString(url);
+
+ if (!string.IsNullOrEmpty(response))
+ {
+ return JsonConvert.DeserializeObject(response);
+ }
+ }
+
+ return null;
+ }
+
+ public string GetArtifactDownloadURL(string jobId, string fileName)
+ {
+ return $"{APIURL}/buildjobs/{jobId}/artifacts/{fileName}";
+ }
+ }
+
+ public class AppVeyorProject
+ {
+ public AppVeyorProjectInfo project { get; set; }
+ public AppVeyorProjectBuild build { get; set; }
+ }
+
+ public class AppVeyorProjectInfo
+ {
+ }
+
+ public class AppVeyorProjectBuild
+ {
+ public AppVeyorProjectJob[] jobs { get; set; }
+ public string version { get; set; }
+ public string status { get; set; }
+ }
+
+ public class AppVeyorProjectJob
+ {
+ public string jobId { get; set; }
+ public string name { get; set; }
+ public string osType { get; set; }
+ public string status { get; set; }
+ }
+
+ public class AppVeyorProjectArtifact
+ {
+ public string fileName { get; set; }
+ public string name { get; set; }
+ public string type { get; set; }
+ public long size { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/ShareX.HelpersLib/UpdateChecker/AppVeyorUpdateChecker.cs b/ShareX.HelpersLib/UpdateChecker/AppVeyorUpdateChecker.cs
new file mode 100644
index 000000000..378775eed
--- /dev/null
+++ b/ShareX.HelpersLib/UpdateChecker/AppVeyorUpdateChecker.cs
@@ -0,0 +1,90 @@
+#region License Information (GPL v3)
+
+/*
+ ShareX - A program that allows you to take screenshots and share any file type
+ Copyright (c) 2007-2017 ShareX Team
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ Optionally you can also view the license at .
+*/
+
+#endregion License Information (GPL v3)
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace ShareX.HelpersLib
+{
+ public class AppVeyorUpdateChecker : UpdateChecker
+ {
+ public override void CheckUpdate()
+ {
+ try
+ {
+ AppVeyor appveyor = new AppVeyor()
+ {
+ AccountName = "ShareX",
+ ProjectSlug = "sharex",
+ Proxy = Proxy
+ };
+
+ AppVeyorProject project = appveyor.GetProjectByBranch("master");
+
+ if (!project.build.status.Equals("success", StringComparison.InvariantCultureIgnoreCase))
+ {
+ throw new Exception("Latest project build is not successful.");
+ }
+
+ AppVeyorProjectJob job = project.build.jobs.FirstOrDefault(x =>
+ x.name.Equals("Configuration: Release", StringComparison.InvariantCultureIgnoreCase) &&
+ x.osType.Equals("Windows", StringComparison.InvariantCultureIgnoreCase) &&
+ x.status.Equals("success", StringComparison.InvariantCultureIgnoreCase));
+
+ if (job == null)
+ {
+ throw new Exception("Unable to find successful release build.");
+ }
+
+ AppVeyorProjectArtifact[] artifacts = appveyor.GetArtifacts(job.jobId);
+
+ AppVeyorProjectArtifact artifact = artifacts.FirstOrDefault(x => x.name.Equals("Setup", StringComparison.InvariantCultureIgnoreCase));
+
+ if (artifact == null)
+ {
+ throw new Exception("Unable to find setup file.");
+ }
+
+ Filename = artifact.fileName;
+ DownloadURL = appveyor.GetArtifactDownloadURL(job.jobId, artifact.fileName);
+ if (Version.TryParse(project.build.version, out Version version))
+ {
+ LatestVersion = version;
+ }
+ RefreshStatus();
+ Status = UpdateStatus.UpdateAvailable;
+ return;
+ }
+ catch (Exception e)
+ {
+ e.ShowError();
+ }
+
+ Status = UpdateStatus.UpdateCheckFailed;
+ }
+ }
+}
diff --git a/ShareX/Forms/ApplicationSettingsForm.Designer.cs b/ShareX/Forms/ApplicationSettingsForm.Designer.cs
index 17ca0d7d8..152bf24a4 100644
--- a/ShareX/Forms/ApplicationSettingsForm.Designer.cs
+++ b/ShareX/Forms/ApplicationSettingsForm.Designer.cs
@@ -218,6 +218,7 @@ private void InitializeComponent()
this.cbCheckPreReleaseUpdates.Name = "cbCheckPreReleaseUpdates";
this.cbCheckPreReleaseUpdates.UseVisualStyleBackColor = true;
this.cbCheckPreReleaseUpdates.CheckedChanged += new System.EventHandler(this.cbCheckPreReleaseUpdates_CheckedChanged);
+ this.cbCheckPreReleaseUpdates.MouseUp += new System.Windows.Forms.MouseEventHandler(this.cbCheckPreReleaseUpdates_MouseUp);
//
// cbTrayMiddleClickAction
//
@@ -1031,6 +1032,7 @@ private void InitializeComponent()
//
this.pgSettings.CategoryForeColor = System.Drawing.SystemColors.InactiveCaptionText;
resources.ApplyResources(this.pgSettings, "pgSettings");
+ this.pgSettings.LineColor = System.Drawing.SystemColors.ControlDark;
this.pgSettings.Name = "pgSettings";
this.pgSettings.PropertySort = System.Windows.Forms.PropertySort.Categorized;
this.pgSettings.ToolbarVisible = false;
diff --git a/ShareX/Forms/ApplicationSettingsForm.cs b/ShareX/Forms/ApplicationSettingsForm.cs
index d92f1312c..5695e0318 100644
--- a/ShareX/Forms/ApplicationSettingsForm.cs
+++ b/ShareX/Forms/ApplicationSettingsForm.cs
@@ -397,6 +397,14 @@ private void cbCheckPreReleaseUpdates_CheckedChanged(object sender, EventArgs e)
Program.Settings.CheckPreReleaseUpdates = cbCheckPreReleaseUpdates.Checked;
}
+ private void cbCheckPreReleaseUpdates_MouseUp(object sender, MouseEventArgs e)
+ {
+ if (e.Button == MouseButtons.Middle)
+ {
+ TaskHelpers.DownloadAppVeyorBuild();
+ }
+ }
+
#endregion General
#region Integration
diff --git a/ShareX/TaskHelpers.cs b/ShareX/TaskHelpers.cs
index 9bf08a0d4..62cb53892 100644
--- a/ShareX/TaskHelpers.cs
+++ b/ShareX/TaskHelpers.cs
@@ -1596,5 +1596,17 @@ public static void ToggleActionsToolbar()
ActionsToolbarForm.Instance.ForceActivate();
}
}
+
+ public static void DownloadAppVeyorBuild()
+ {
+ AppVeyorUpdateChecker updateChecker = new AppVeyorUpdateChecker()
+ {
+ IsBeta = Program.Beta,
+ IsPortable = Program.Portable,
+ Proxy = HelpersOptions.CurrentProxy.GetWebProxy()
+ };
+ updateChecker.CheckUpdate();
+ UpdateMessageBox.Start(updateChecker);
+ }
}
}
\ No newline at end of file