Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Aug 29, 2024
1 parent f10f7b6 commit f0dbb6b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions v2rayN/ServiceLib/Common/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -572,14 +572,14 @@ public static string GetVersion(bool blFull = true)
{
return string.Format("{0} - V{1} - {2}",
Global.AppName,
FileVersionInfo.GetVersionInfo(location).FileVersion?.ToString(),
GetVersionInfo(),
File.GetLastWriteTime(location).ToString("yyyy/MM/dd"));
}
else
{
return string.Format("{0}/{1}",
Global.AppName,
FileVersionInfo.GetVersionInfo(location).FileVersion?.ToString());
GetVersionInfo());
}
}
catch (Exception ex)
Expand All @@ -589,6 +589,20 @@ public static string GetVersion(bool blFull = true)
}
}

public static string GetVersionInfo()
{
try
{
string location = GetExePath();
return FileVersionInfo.GetVersionInfo(location)?.FileVersion ?? "0.0";
}
catch (Exception ex)
{
Logging.SaveLog(ex.Message, ex);
return "0.0";
}
}

/// <summary>
/// 取得GUID
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/ServiceLib/Handler/UpdateHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ private void ResponseHandler(ECoreType type, string gitHubReleaseApi, bool preRe
}
case ECoreType.v2rayN:
{
curVersion = new SemanticVersion(FileVersionInfo.GetVersionInfo(Utils.GetExePath()).FileVersion.ToString());
curVersion = new SemanticVersion(Utils.GetVersionInfo());
message = string.Format(ResUI.IsLatestN, type, curVersion);
url = string.Format(GetUrlFromCore(coreInfo), version);
break;
Expand Down

0 comments on commit f0dbb6b

Please sign in to comment.