Added "Update channel" option

This commit is contained in:
Jaex 2024-04-02 08:29:07 +03:00
parent a92bafb725
commit a993f1b94d
15 changed files with 212 additions and 93 deletions

View File

@ -3,7 +3,7 @@
<Company>ShareX Team</Company>
<Product>ShareX</Product>
<Copyright>Copyright (c) 2007-2024 ShareX Team</Copyright>
<Version>16.0.2</Version>
<Version>16.0.3</Version>
<EmbeddedResourceUseDependentUponConvention>true</EmbeddedResourceUseDependentUponConvention>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>

View File

@ -323,9 +323,12 @@ namespace ShareX.HelpersLib
return source.Reverse().Take(count).Reverse();
}
public static Version Normalize(this Version version)
public static Version Normalize(this Version version, bool ignoreRevision = false, bool ignoreBuild = false, bool ignoreMinor = false)
{
return new Version(Math.Max(version.Major, 0), Math.Max(version.Minor, 0), Math.Max(version.Build, 0), Math.Max(version.Revision, 0));
return new Version(Math.Max(version.Major, 0),
ignoreMinor ? 0 : Math.Max(version.Minor, 0),
ignoreBuild ? 0 : Math.Max(version.Build, 0),
ignoreRevision ? 0 : Math.Max(version.Revision, 0));
}
public static void Move<T>(this List<T> list, int oldIndex, int newIndex)

View File

@ -291,9 +291,9 @@ namespace ShareX.HelpersLib
/// If version1 equal to version2 = 0
/// If version1 older than version2 = -1
/// </summary>
public static int CompareVersion(string version1, string version2)
public static int CompareVersion(string version1, string version2, bool ignoreRevision = false)
{
return NormalizeVersion(version1).CompareTo(NormalizeVersion(version2));
return NormalizeVersion(version1, ignoreRevision).CompareTo(NormalizeVersion(version2, ignoreRevision));
}
/// <summary>
@ -301,9 +301,9 @@ namespace ShareX.HelpersLib
/// If version1 equal to version2 = 0
/// If version1 older than version2 = -1
/// </summary>
public static int CompareVersion(Version version1, Version version2)
public static int CompareVersion(Version version1, Version version2, bool ignoreRevision = false)
{
return version1.Normalize().CompareTo(version2.Normalize());
return version1.Normalize(ignoreRevision).CompareTo(version2.Normalize(ignoreRevision));
}
/// <summary>
@ -316,9 +316,9 @@ namespace ShareX.HelpersLib
return CompareVersion(version, GetApplicationVersion(includeRevision));
}
public static Version NormalizeVersion(string version)
public static Version NormalizeVersion(string version, bool ignoreRevision = false)
{
return Version.Parse(version).Normalize();
return Version.Parse(version).Normalize(ignoreRevision);
}
public static bool IsWindowsXP()

View File

@ -1286,4 +1286,13 @@ Would you like to download and install it?</value>
<data name="HotkeyType_CustomWindow" xml:space="preserve">
<value>Capture pre configured window</value>
</data>
<data name="UpdateChannel_Dev" xml:space="preserve">
<value>Dev</value>
</data>
<data name="UpdateChannel_PreRelease" xml:space="preserve">
<value>Pre-release</value>
</data>
<data name="UpdateChannel_Release" xml:space="preserve">
<value>Release</value>
</data>
</root>

View File

@ -44,6 +44,10 @@ namespace ShareX.HelpersLib
private Timer updateTimer = null;
private readonly object updateTimerLock = new object();
public GitHubUpdateManager()
{
}
public GitHubUpdateManager(string owner, string repo, bool portable = false)
{
GitHubOwner = owner;
@ -90,7 +94,7 @@ namespace ShareX.HelpersLib
}
}
public GitHubUpdateChecker CreateUpdateChecker()
public virtual GitHubUpdateChecker CreateUpdateChecker()
{
return new GitHubUpdateChecker(GitHubOwner, GitHubRepo)
{

View File

@ -41,6 +41,7 @@ namespace ShareX.HelpersLib
public ReleaseChannelType ReleaseType { get; set; }
public bool IsDev { get; set; }
public bool IsPortable { get; set; }
public bool IgnoreRevision { get; set; }
private string fileName;
@ -71,7 +72,7 @@ namespace ShareX.HelpersLib
}
if (Status != UpdateStatus.UpdateCheckFailed && CurrentVersion != null && LatestVersion != null && !string.IsNullOrEmpty(DownloadURL) &&
(ForceUpdate || Helpers.CompareVersion(CurrentVersion, LatestVersion) < 0))
(ForceUpdate || Helpers.CompareVersion(CurrentVersion, LatestVersion, IgnoreRevision) < 0))
{
Status = UpdateStatus.UpdateAvailable;
}

View File

@ -73,6 +73,8 @@ namespace ShareX
public HotkeyType TrayMiddleClickAction = HotkeyType.ClipboardUploadWithContentViewer;
public bool AutoCheckUpdate = true;
public UpdateChannel UpdateChannel = UpdateChannel.Release;
// TEMP: For backward compatibility
public bool CheckPreReleaseUpdates = false;
#endregion General

View File

@ -42,6 +42,13 @@ namespace ShareX
Unknown
}
public enum UpdateChannel // Localized
{
Release,
PreRelease,
Dev
}
public enum SupportedLanguage
{
Automatic, // Localized

View File

@ -33,10 +33,11 @@ namespace ShareX
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ApplicationSettingsForm));
this.tcSettings = new System.Windows.Forms.TabControl();
this.tpGeneral = new System.Windows.Forms.TabPage();
this.cbUpdateChannel = new System.Windows.Forms.ComboBox();
this.lblUpdateChannel = new System.Windows.Forms.Label();
this.cbAutoCheckUpdate = new System.Windows.Forms.CheckBox();
this.cbUseWhiteShareXIcon = new System.Windows.Forms.CheckBox();
this.btnCheckDevBuild = new System.Windows.Forms.Button();
this.cbCheckPreReleaseUpdates = new System.Windows.Forms.CheckBox();
this.cbTrayMiddleClickAction = new System.Windows.Forms.ComboBox();
this.lblTrayMiddleClickAction = new System.Windows.Forms.Label();
this.cbTrayLeftDoubleClickAction = new System.Windows.Forms.ComboBox();
@ -237,10 +238,11 @@ namespace ShareX
// tpGeneral
//
this.tpGeneral.BackColor = System.Drawing.SystemColors.Window;
this.tpGeneral.Controls.Add(this.cbUpdateChannel);
this.tpGeneral.Controls.Add(this.lblUpdateChannel);
this.tpGeneral.Controls.Add(this.cbAutoCheckUpdate);
this.tpGeneral.Controls.Add(this.cbUseWhiteShareXIcon);
this.tpGeneral.Controls.Add(this.btnCheckDevBuild);
this.tpGeneral.Controls.Add(this.cbCheckPreReleaseUpdates);
this.tpGeneral.Controls.Add(this.cbTrayMiddleClickAction);
this.tpGeneral.Controls.Add(this.lblTrayMiddleClickAction);
this.tpGeneral.Controls.Add(this.cbTrayLeftDoubleClickAction);
@ -259,6 +261,19 @@ namespace ShareX
resources.ApplyResources(this.tpGeneral, "tpGeneral");
this.tpGeneral.Name = "tpGeneral";
//
// cbUpdateChannel
//
this.cbUpdateChannel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbUpdateChannel.FormattingEnabled = true;
resources.ApplyResources(this.cbUpdateChannel, "cbUpdateChannel");
this.cbUpdateChannel.Name = "cbUpdateChannel";
this.cbUpdateChannel.SelectedIndexChanged += new System.EventHandler(this.cbUpdateChannel_SelectedIndexChanged);
//
// lblUpdateChannel
//
resources.ApplyResources(this.lblUpdateChannel, "lblUpdateChannel");
this.lblUpdateChannel.Name = "lblUpdateChannel";
//
// cbAutoCheckUpdate
//
resources.ApplyResources(this.cbAutoCheckUpdate, "cbAutoCheckUpdate");
@ -280,13 +295,6 @@ namespace ShareX
this.btnCheckDevBuild.UseVisualStyleBackColor = true;
this.btnCheckDevBuild.Click += new System.EventHandler(this.btnCheckDevBuild_Click);
//
// cbCheckPreReleaseUpdates
//
resources.ApplyResources(this.cbCheckPreReleaseUpdates, "cbCheckPreReleaseUpdates");
this.cbCheckPreReleaseUpdates.Name = "cbCheckPreReleaseUpdates";
this.cbCheckPreReleaseUpdates.UseVisualStyleBackColor = true;
this.cbCheckPreReleaseUpdates.CheckedChanged += new System.EventHandler(this.cbCheckPreReleaseUpdates_CheckedChanged);
//
// cbTrayMiddleClickAction
//
this.cbTrayMiddleClickAction.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@ -1587,7 +1595,6 @@ namespace ShareX
private System.Windows.Forms.ComboBox cbTrayMiddleClickAction;
private System.Windows.Forms.ComboBox cbTrayLeftDoubleClickAction;
private System.Windows.Forms.ComboBox cbTrayLeftClickAction;
private System.Windows.Forms.CheckBox cbCheckPreReleaseUpdates;
private System.Windows.Forms.Button btnChromeOpenExtensionPage;
private System.Windows.Forms.GroupBox gbFirefox;
private System.Windows.Forms.Button btnFirefoxOpenAddonPage;
@ -1642,5 +1649,7 @@ namespace ShareX
private System.Windows.Forms.TextBox txtSaveImageSubFolderPatternWindow;
private System.Windows.Forms.Label lblSaveImageSubFolderPatternWindow;
private System.Windows.Forms.CheckBox cbAutoCheckUpdate;
private System.Windows.Forms.ComboBox cbUpdateChannel;
private System.Windows.Forms.Label lblUpdateChannel;
}
}

View File

@ -80,7 +80,7 @@ namespace ShareX
cbTrayLeftDoubleClickAction.Items.AddRange(Helpers.GetLocalizedEnumDescriptions<HotkeyType>());
cbTrayLeftClickAction.Items.AddRange(Helpers.GetLocalizedEnumDescriptions<HotkeyType>());
cbTrayMiddleClickAction.Items.AddRange(Helpers.GetLocalizedEnumDescriptions<HotkeyType>());
cbUpdateChannel.Items.AddRange(Helpers.GetLocalizedEnumDescriptions<UpdateChannel>());
cbMainWindowTaskViewMode.Items.AddRange(Helpers.GetLocalizedEnumDescriptions<TaskViewMode>());
cbThumbnailViewTitleLocation.Items.AddRange(Helpers.GetLocalizedEnumDescriptions<ThumbnailTitleLocation>());
cbThumbnailViewThumbnailClickAction.Items.AddRange(Helpers.GetLocalizedEnumDescriptions<ThumbnailViewClickAction>());
@ -121,20 +121,22 @@ namespace ShareX
#if STEAM || MicrosoftStore
cbAutoCheckUpdate.Visible = false;
cbCheckPreReleaseUpdates.Visible = false;
lblUpdateChannel.Visible = false;
cbUpdateChannel.Visible = false;
btnCheckDevBuild.Visible = false;
#else
if (SystemOptions.DisableUpdateCheck)
{
cbAutoCheckUpdate.Visible = false;
cbCheckPreReleaseUpdates.Visible = false;
lblUpdateChannel.Visible = false;
cbUpdateChannel.Visible = false;
btnCheckDevBuild.Visible = false;
}
else
{
cbAutoCheckUpdate.Checked = Program.Settings.AutoCheckUpdate;
cbCheckPreReleaseUpdates.Enabled = Program.Settings.AutoCheckUpdate;
cbCheckPreReleaseUpdates.Checked = Program.Settings.CheckPreReleaseUpdates;
cbUpdateChannel.Enabled = Program.Settings.AutoCheckUpdate;
cbUpdateChannel.SelectedIndex = (int)Program.Settings.UpdateChannel;
}
#endif
@ -450,12 +452,12 @@ namespace ShareX
private void cbAutoCheckUpdate_CheckedChanged(object sender, EventArgs e)
{
Program.Settings.AutoCheckUpdate = cbAutoCheckUpdate.Checked;
cbCheckPreReleaseUpdates.Enabled = Program.Settings.AutoCheckUpdate;
cbUpdateChannel.Enabled = Program.Settings.AutoCheckUpdate;
}
private void cbCheckPreReleaseUpdates_CheckedChanged(object sender, EventArgs e)
private void cbUpdateChannel_SelectedIndexChanged(object sender, EventArgs e)
{
Program.Settings.CheckPreReleaseUpdates = cbCheckPreReleaseUpdates.Checked;
Program.Settings.UpdateChannel = (UpdateChannel)cbUpdateChannel.SelectedIndex;
}
private async void btnCheckDevBuild_Click(object sender, EventArgs e)

View File

@ -121,13 +121,61 @@
<data name="tcSettings.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Bottom, Left, Right</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="cbUpdateChannel.Location" type="System.Drawing.Point, System.Drawing">
<value>248, 276</value>
</data>
<data name="cbUpdateChannel.Size" type="System.Drawing.Size, System.Drawing">
<value>144, 21</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="cbUpdateChannel.TabIndex" type="System.Int32, mscorlib">
<value>18</value>
</data>
<data name="&gt;&gt;cbUpdateChannel.Name" xml:space="preserve">
<value>cbUpdateChannel</value>
</data>
<data name="&gt;&gt;cbUpdateChannel.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cbUpdateChannel.Parent" xml:space="preserve">
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;cbUpdateChannel.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="lblUpdateChannel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="lblUpdateChannel.Location" type="System.Drawing.Point, System.Drawing">
<value>13, 280</value>
</data>
<data name="lblUpdateChannel.Size" type="System.Drawing.Size, System.Drawing">
<value>86, 13</value>
</data>
<data name="lblUpdateChannel.TabIndex" type="System.Int32, mscorlib">
<value>17</value>
</data>
<data name="lblUpdateChannel.Text" xml:space="preserve">
<value>Update channel:</value>
</data>
<data name="&gt;&gt;lblUpdateChannel.Name" xml:space="preserve">
<value>lblUpdateChannel</value>
</data>
<data name="&gt;&gt;lblUpdateChannel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;lblUpdateChannel.Parent" xml:space="preserve">
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;lblUpdateChannel.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="cbAutoCheckUpdate.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="cbAutoCheckUpdate.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 248</value>
<value>16, 256</value>
</data>
<data name="cbAutoCheckUpdate.Size" type="System.Drawing.Size, System.Drawing">
<value>177, 17</value>
@ -148,7 +196,7 @@
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;cbAutoCheckUpdate.ZOrder" xml:space="preserve">
<value>0</value>
<value>2</value>
</data>
<data name="cbUseWhiteShareXIcon.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -178,19 +226,19 @@
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;cbUseWhiteShareXIcon.ZOrder" xml:space="preserve">
<value>1</value>
<value>3</value>
</data>
<data name="btnCheckDevBuild.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnCheckDevBuild.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 296</value>
<value>16, 304</value>
</data>
<data name="btnCheckDevBuild.Size" type="System.Drawing.Size, System.Drawing">
<value>288, 23</value>
<value>288, 32</value>
</data>
<data name="btnCheckDevBuild.TabIndex" type="System.Int32, mscorlib">
<value>18</value>
<value>19</value>
</data>
<data name="btnCheckDevBuild.Text" xml:space="preserve">
<value>Install dev build...</value>
@ -205,37 +253,7 @@
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;btnCheckDevBuild.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="cbCheckPreReleaseUpdates.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="cbCheckPreReleaseUpdates.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="cbCheckPreReleaseUpdates.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 272</value>
</data>
<data name="cbCheckPreReleaseUpdates.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 17</value>
</data>
<data name="cbCheckPreReleaseUpdates.TabIndex" type="System.Int32, mscorlib">
<value>17</value>
</data>
<data name="cbCheckPreReleaseUpdates.Text" xml:space="preserve">
<value>Check for pre-release updates</value>
</data>
<data name="&gt;&gt;cbCheckPreReleaseUpdates.Name" xml:space="preserve">
<value>cbCheckPreReleaseUpdates</value>
</data>
<data name="&gt;&gt;cbCheckPreReleaseUpdates.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cbCheckPreReleaseUpdates.Parent" xml:space="preserve">
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;cbCheckPreReleaseUpdates.ZOrder" xml:space="preserve">
<value>3</value>
<value>4</value>
</data>
<data name="cbTrayMiddleClickAction.Location" type="System.Drawing.Point, System.Drawing">
<value>248, 188</value>
@ -256,7 +274,7 @@
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;cbTrayMiddleClickAction.ZOrder" xml:space="preserve">
<value>4</value>
<value>5</value>
</data>
<data name="lblTrayMiddleClickAction.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -286,7 +304,7 @@
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;lblTrayMiddleClickAction.ZOrder" xml:space="preserve">
<value>5</value>
<value>6</value>
</data>
<data name="cbTrayLeftDoubleClickAction.Location" type="System.Drawing.Point, System.Drawing">
<value>248, 164</value>
@ -307,7 +325,7 @@
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;cbTrayLeftDoubleClickAction.ZOrder" xml:space="preserve">
<value>6</value>
<value>7</value>
</data>
<data name="lblTrayLeftDoubleClickAction.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -337,7 +355,7 @@
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;lblTrayLeftDoubleClickAction.ZOrder" xml:space="preserve">
<value>7</value>
<value>8</value>
</data>
<data name="cbTrayLeftClickAction.Location" type="System.Drawing.Point, System.Drawing">
<value>248, 140</value>
@ -358,7 +376,7 @@
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;cbTrayLeftClickAction.ZOrder" xml:space="preserve">
<value>8</value>
<value>9</value>
</data>
<data name="lblTrayLeftClickAction.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -388,7 +406,7 @@
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;lblTrayLeftClickAction.ZOrder" xml:space="preserve">
<value>9</value>
<value>10</value>
</data>
<data name="btnEditQuickTaskMenu.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
@ -397,7 +415,7 @@
<value>16, 216</value>
</data>
<data name="btnEditQuickTaskMenu.Size" type="System.Drawing.Size, System.Drawing">
<value>288, 23</value>
<value>288, 32</value>
</data>
<data name="btnEditQuickTaskMenu.TabIndex" type="System.Int32, mscorlib">
<value>15</value>
@ -415,7 +433,7 @@
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;btnEditQuickTaskMenu.ZOrder" xml:space="preserve">
<value>10</value>
<value>11</value>
</data>
<data name="cbShowTray.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -445,7 +463,7 @@
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;cbShowTray.ZOrder" xml:space="preserve">
<value>11</value>
<value>12</value>
</data>
<data name="cbTrayIconProgressEnabled.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -475,7 +493,7 @@
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;cbTrayIconProgressEnabled.ZOrder" xml:space="preserve">
<value>12</value>
<value>13</value>
</data>
<data name="btnLanguages.ImageAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
@ -514,13 +532,13 @@
<value>btnLanguages</value>
</data>
<data name="&gt;&gt;btnLanguages.Type" xml:space="preserve">
<value>ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=16.0.2.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;btnLanguages.Parent" xml:space="preserve">
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;btnLanguages.ZOrder" xml:space="preserve">
<value>13</value>
<value>14</value>
</data>
<data name="cbRememberMainFormPosition.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -550,7 +568,7 @@
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;cbRememberMainFormPosition.ZOrder" xml:space="preserve">
<value>14</value>
<value>15</value>
</data>
<data name="cbSilentRun.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -580,7 +598,7 @@
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;cbSilentRun.ZOrder" xml:space="preserve">
<value>15</value>
<value>16</value>
</data>
<data name="cbTaskbarProgressEnabled.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -610,7 +628,7 @@
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;cbTaskbarProgressEnabled.ZOrder" xml:space="preserve">
<value>16</value>
<value>17</value>
</data>
<data name="cbRememberMainFormSize.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -640,7 +658,7 @@
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;cbRememberMainFormSize.ZOrder" xml:space="preserve">
<value>17</value>
<value>18</value>
</data>
<data name="lblLanguage.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -670,7 +688,7 @@
<value>tpGeneral</value>
</data>
<data name="&gt;&gt;lblLanguage.ZOrder" xml:space="preserve">
<value>18</value>
<value>19</value>
</data>
<data name="tpGeneral.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 22</value>
@ -868,7 +886,7 @@
<value>eiTheme</value>
</data>
<data name="&gt;&gt;eiTheme.Type" xml:space="preserve">
<value>ShareX.HelpersLib.ExportImportControl, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.HelpersLib.ExportImportControl, ShareX.HelpersLib, Version=16.0.2.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;eiTheme.Parent" xml:space="preserve">
<value>tpTheme</value>
@ -2767,7 +2785,7 @@
<value>lvClipboardFormats</value>
</data>
<data name="&gt;&gt;lvClipboardFormats.Type" xml:space="preserve">
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=16.0.2.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lvClipboardFormats.Parent" xml:space="preserve">
<value>tpClipboardFormats</value>
@ -2818,7 +2836,7 @@
<value>lvSecondaryFileUploaders</value>
</data>
<data name="&gt;&gt;lvSecondaryFileUploaders.Type" xml:space="preserve">
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=16.0.2.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lvSecondaryFileUploaders.Parent" xml:space="preserve">
<value>gbSecondaryFileUploaders</value>
@ -2899,7 +2917,7 @@
<value>lvSecondaryImageUploaders</value>
</data>
<data name="&gt;&gt;lvSecondaryImageUploaders.Type" xml:space="preserve">
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=16.0.2.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lvSecondaryImageUploaders.Parent" xml:space="preserve">
<value>gbSecondaryImageUploaders</value>
@ -2950,7 +2968,7 @@
<value>lvSecondaryTextUploaders</value>
</data>
<data name="&gt;&gt;lvSecondaryTextUploaders.Type" xml:space="preserve">
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=16.0.2.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;lvSecondaryTextUploaders.Parent" xml:space="preserve">
<value>gbSecondaryTextUploaders</value>
@ -4060,7 +4078,7 @@
<value>tttvMain</value>
</data>
<data name="&gt;&gt;tttvMain.Type" xml:space="preserve">
<value>ShareX.HelpersLib.TabToTreeView, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
<value>ShareX.HelpersLib.TabToTreeView, ShareX.HelpersLib, Version=16.0.2.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;tttvMain.Parent" xml:space="preserve">
<value>$this</value>

View File

@ -948,7 +948,7 @@ namespace ShareX
private void ConfigureAutoUpdate()
{
Program.UpdateManager.AllowAutoUpdate = !SystemOptions.DisableUpdateCheck && Program.Settings.AutoCheckUpdate;
Program.UpdateManager.CheckPreReleaseUpdates = Program.Settings.CheckPreReleaseUpdates;
Program.UpdateManager.UpdateChannel = Program.Settings.UpdateChannel;
Program.UpdateManager.ConfigureAutoUpdate();
}

View File

@ -130,7 +130,7 @@ namespace ShareX
internal static Stopwatch StartTimer { get; private set; }
internal static HotkeyManager HotkeyManager { get; set; }
internal static WatchFolderManager WatchFolderManager { get; set; }
internal static GitHubUpdateManager UpdateManager { get; private set; }
internal static ShareXUpdateManager UpdateManager { get; private set; }
internal static ShareXCLIManager CLI { get; private set; }
#region Paths
@ -356,7 +356,7 @@ namespace ShareX
SettingManager.LoadInitialSettings();
Uploader.UpdateServicePointManager();
UpdateManager = new GitHubUpdateManager("ShareX", "ShareX", Portable);
UpdateManager = new ShareXUpdateManager();
LanguageHelper.ChangeLanguage(Settings.Language);
CleanupManager.CleanupAsync();
Helpers.TryFixHandCursor();

View File

@ -235,6 +235,14 @@ namespace ShareX
DefaultTaskSettings.CaptureSettings.ScrollingCaptureOptions = new ScrollingCaptureOptions();
DefaultTaskSettings.CaptureSettings.FFmpegOptions.FixSources();
}
if (Settings.IsUpgradeFrom("16.0.2"))
{
if (Settings.CheckPreReleaseUpdates)
{
Settings.UpdateChannel = UpdateChannel.PreRelease;
}
}
}
private static void MigrateHistoryFile()

View File

@ -0,0 +1,56 @@
#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright (c) 2007-2024 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 <http://www.gnu.org/licenses/>.
*/
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
namespace ShareX
{
internal class ShareXUpdateManager : GitHubUpdateManager
{
public UpdateChannel UpdateChannel { get; set; }
public override GitHubUpdateChecker CreateUpdateChecker()
{
if (UpdateChannel == UpdateChannel.Dev)
{
return new GitHubUpdateChecker("ShareX", "DevBuilds")
{
IsDev = true,
IsPortable = Program.Portable,
IgnoreRevision = true
};
}
else
{
return new GitHubUpdateChecker("ShareX", "ShareX")
{
IsPortable = Program.Portable,
IncludePreRelease = UpdateChannel == UpdateChannel.PreRelease,
IgnoreRevision = true
};
}
}
}
}