From 82eb3fd6bd2b7b3d50e6efa928f1c8545c9cac25 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Tue, 3 Sep 2024 10:16:50 +0800 Subject: [PATCH] Unified processing version --- v2rayN/ServiceLib/Common/SemanticVersion.cs | 2 +- v2rayN/ServiceLib/Common/Utils.cs | 3 +-- v2rayN/ServiceLib/ServiceLib.csproj | 3 ++- v2rayN/v2rayN.Desktop/v2rayN.Desktop.csproj | 5 ++--- v2rayN/v2rayN/v2rayN.csproj | 1 - 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/v2rayN/ServiceLib/Common/SemanticVersion.cs b/v2rayN/ServiceLib/Common/SemanticVersion.cs index ec4c4931..c631de5b 100644 --- a/v2rayN/ServiceLib/Common/SemanticVersion.cs +++ b/v2rayN/ServiceLib/Common/SemanticVersion.cs @@ -27,7 +27,7 @@ this.minor = int.Parse(parts[1]); this.patch = 0; } - else if (parts.Length == 3) + else if (parts.Length == 3 || parts.Length == 4) { this.major = int.Parse(parts[0]); this.minor = int.Parse(parts[1]); diff --git a/v2rayN/ServiceLib/Common/Utils.cs b/v2rayN/ServiceLib/Common/Utils.cs index ec161ced..dd36758d 100644 --- a/v2rayN/ServiceLib/Common/Utils.cs +++ b/v2rayN/ServiceLib/Common/Utils.cs @@ -593,8 +593,7 @@ namespace ServiceLib.Common { try { - string location = GetExePath(); - return FileVersionInfo.GetVersionInfo(location)?.FileVersion ?? "0.0"; + return Assembly.GetExecutingAssembly()?.GetName()?.Version?.ToString() ?? "0.0"; } catch (Exception ex) { diff --git a/v2rayN/ServiceLib/ServiceLib.csproj b/v2rayN/ServiceLib/ServiceLib.csproj index bc138c00..b37840c5 100644 --- a/v2rayN/ServiceLib/ServiceLib.csproj +++ b/v2rayN/ServiceLib/ServiceLib.csproj @@ -4,6 +4,7 @@ net8.0 enable enable + 6.55 @@ -12,7 +13,7 @@ - + diff --git a/v2rayN/v2rayN.Desktop/v2rayN.Desktop.csproj b/v2rayN/v2rayN.Desktop/v2rayN.Desktop.csproj index c5496803..f0f36b65 100644 --- a/v2rayN/v2rayN.Desktop/v2rayN.Desktop.csproj +++ b/v2rayN/v2rayN.Desktop/v2rayN.Desktop.csproj @@ -7,7 +7,6 @@ v2rayN.ico true true - 6.55 @@ -26,8 +25,8 @@ - - + + diff --git a/v2rayN/v2rayN/v2rayN.csproj b/v2rayN/v2rayN/v2rayN.csproj index 9318fe4d..01628743 100644 --- a/v2rayN/v2rayN/v2rayN.csproj +++ b/v2rayN/v2rayN/v2rayN.csproj @@ -10,7 +10,6 @@ enable v2rayN.ico Copyright © 2017-2024 (GPLv3) - 6.56 7.0