From 2e4501187c8510ceafe27c592ba83625ea84d51d Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Wed, 1 Jan 2025 10:38:55 +0800 Subject: [PATCH] Window title display adjustment https://github.com/2dust/v2rayN/issues/6389 --- v2rayN/ServiceLib/Common/Utils.cs | 7 ++++++- v2rayN/ServiceLib/Handler/AppHandler.cs | 3 +-- v2rayN/ServiceLib/Handler/CoreHandler.cs | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/v2rayN/ServiceLib/Common/Utils.cs b/v2rayN/ServiceLib/Common/Utils.cs index 3aec2a9b..95764f16 100644 --- a/v2rayN/ServiceLib/Common/Utils.cs +++ b/v2rayN/ServiceLib/Common/Utils.cs @@ -530,7 +530,7 @@ namespace ServiceLib.Common try { return blFull - ? $"{Global.AppName} - V{GetVersionInfo()} - {RuntimeInformation.ProcessArchitecture} - {StartupPath()}" + ? $"{Global.AppName} - V{GetVersionInfo()} - {RuntimeInformation.ProcessArchitecture}" : $"{Global.AppName}/{GetVersionInfo()}"; } catch (Exception ex) @@ -554,6 +554,11 @@ namespace ServiceLib.Common } } + public static string GetRuntimeInfo() + { + return $"{Utils.GetVersion()} | {Utils.StartupPath()} | {Utils.GetExePath()} | {Environment.OSVersion} | {(Environment.Is64BitOperatingSystem ? 64 : 32)}"; + } + /// /// 取得GUID /// diff --git a/v2rayN/ServiceLib/Handler/AppHandler.cs b/v2rayN/ServiceLib/Handler/AppHandler.cs index 31cb8b2e..bf94fdf9 100644 --- a/v2rayN/ServiceLib/Handler/AppHandler.cs +++ b/v2rayN/ServiceLib/Handler/AppHandler.cs @@ -77,8 +77,7 @@ public bool InitComponents() { - Logging.SaveLog($"v2rayN start up | {Utils.GetVersion()} | {Utils.GetExePath()}"); - Logging.SaveLog($"{Environment.OSVersion} - {(Environment.Is64BitOperatingSystem ? 64 : 32)}"); + Logging.SaveLog($"v2rayN start up | {Utils.GetRuntimeInfo()}"); Logging.LoggingEnabled(_config.GuiItem.EnableLog); Logging.ClearLogs(); diff --git a/v2rayN/ServiceLib/Handler/CoreHandler.cs b/v2rayN/ServiceLib/Handler/CoreHandler.cs index 5dc62332..c8ff05dd 100644 --- a/v2rayN/ServiceLib/Handler/CoreHandler.cs +++ b/v2rayN/ServiceLib/Handler/CoreHandler.cs @@ -67,7 +67,7 @@ namespace ServiceLib.Handler } ShowMsg(true, $"{node.GetSummary()}"); - ShowMsg(false, $"{Environment.OSVersion} - {(Environment.Is64BitOperatingSystem ? 64 : 32)}"); + ShowMsg(false, $"{Utils.GetRuntimeInfo()}"); ShowMsg(false, string.Format(ResUI.StartService, DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"))); await CoreStop(); await Task.Delay(100);