mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 06:52:35 +01:00
Merge pull request #2825 from ivandrofly/check-for-update
[checkforupdateshelper] - compare version using built-in version symbol
This commit is contained in:
commit
e22278ce9c
@ -139,23 +139,7 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
//string[] currentVersionInfo = "3.3.14".Split('.'); // for testing...
|
//string[] currentVersionInfo = "3.3.14".Split('.'); // for testing...
|
||||||
string[] currentVersionInfo = Utilities.AssemblyVersion.Split('.');
|
return Version.Parse(LatestVersionNumber) > Version.Parse(Utilities.AssemblyVersion);
|
||||||
string minorMinorVersion = string.Empty;
|
|
||||||
if (currentVersionInfo.Length >= 3 && currentVersionInfo[2] != "0")
|
|
||||||
minorMinorVersion = "." + currentVersionInfo[2];
|
|
||||||
string currentVersion = $"{currentVersionInfo[0]}.{currentVersionInfo[1]}{minorMinorVersion}";
|
|
||||||
if (currentVersion == LatestVersionNumber)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
string[] latestVersionInfo = LatestVersionNumber.Split('.');
|
|
||||||
if (int.Parse(latestVersionInfo[0]) > int.Parse(currentVersionInfo[0]))
|
|
||||||
return true;
|
|
||||||
if (int.Parse(latestVersionInfo[0]) == int.Parse(currentVersionInfo[0]) && int.Parse(latestVersionInfo[1]) > int.Parse(currentVersionInfo[1]))
|
|
||||||
return true;
|
|
||||||
if (int.Parse(latestVersionInfo[0]) == int.Parse(currentVersionInfo[0]) && int.Parse(latestVersionInfo[1]) == int.Parse(currentVersionInfo[1]) && int.Parse(latestVersionInfo[2]) > int.Parse(currentVersionInfo[2]))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user