From bd467c9af6d456547c79e7018db828c4b2941194 Mon Sep 17 00:00:00 2001 From: js6pak Date: Thu, 11 Jun 2026 12:25:33 +0200 Subject: [PATCH] Expose a DisplayBepInExVersion (#556) --- BepInEx.Core/Paths.cs | 6 ++++++ BepInEx.Preloader.Core/Logging/ChainloaderLogHelper.cs | 9 +++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/BepInEx.Core/Paths.cs b/BepInEx.Core/Paths.cs index 6a37342..a1a44eb 100644 --- a/BepInEx.Core/Paths.cs +++ b/BepInEx.Core/Paths.cs @@ -19,6 +19,12 @@ public static class Paths Version.Parse(MetadataHelper.GetAttributes(typeof(Paths).Assembly)[0] .InformationalVersion); + /// + /// BepInEx version without the build suffix. + /// + public static Version DisplayBepInExVersion { get; } = + new(BepInExVersion.Major, BepInExVersion.Minor, BepInExVersion.Patch, BepInExVersion.PreRelease); + /// /// The path to the Managed folder that contains the main managed assemblies. /// diff --git a/BepInEx.Preloader.Core/Logging/ChainloaderLogHelper.cs b/BepInEx.Preloader.Core/Logging/ChainloaderLogHelper.cs index 43e48e0..73bdc9f 100644 --- a/BepInEx.Preloader.Core/Logging/ChainloaderLogHelper.cs +++ b/BepInEx.Preloader.Core/Logging/ChainloaderLogHelper.cs @@ -35,17 +35,14 @@ public static class ChainloaderLogHelper public static void PrintLogInfo(ManualLogSource log) { - var bepinVersion = Paths.BepInExVersion; - var versionMini = new SemanticVersioning.Version(bepinVersion.Major, bepinVersion.Minor, bepinVersion.Patch, - bepinVersion.PreRelease); - var consoleTitle = $"BepInEx {versionMini} - {Paths.ProcessName}"; + var consoleTitle = $"BepInEx {Paths.DisplayBepInExVersion} - {Paths.ProcessName}"; log.Log(LogLevel.Message, $"{consoleTitle} ({File.GetLastWriteTime(Paths.ExecutablePath)})"); if (ConsoleManager.ConsoleActive) ConsoleManager.SetConsoleTitle(consoleTitle); - if (!string.IsNullOrEmpty(bepinVersion.Build)) - log.Log(LogLevel.Message, $"Built from commit {bepinVersion.Build}"); + if (!string.IsNullOrEmpty(Paths.BepInExVersion.Build)) + log.Log(LogLevel.Message, $"Built from commit {Paths.BepInExVersion.Build}"); Logger.Log(LogLevel.Info, $"System platform: {GetPlatformString()}"); Logger.Log(LogLevel.Info,