Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose a DisplayBepInExVersion #556

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions BepInEx.Core/BepInEx.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<!-- Force nuget assembly output on netstandard2.0 -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<RootNamespace>BepInEx</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All"/>
Expand Down
2 changes: 1 addition & 1 deletion BepInEx.Core/Bootstrap/BaseChainloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ protected static bool PluginTargetsWrongBepin(PluginInfo pluginInfo)

#region Contract

protected virtual string ConsoleTitle => $"BepInEx {Paths.BepInExVersion} - {Paths.ProcessName}";
protected virtual string ConsoleTitle => $"BepInEx {Paths.DisplayBepInExVersion} - {Paths.ProcessName}";

private bool _initialized;

Expand Down
6 changes: 6 additions & 0 deletions BepInEx.Core/Paths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ public static class Paths
Version.Parse(MetadataHelper.GetAttributes<AssemblyInformationalVersionAttribute>(typeof(Paths).Assembly)[0]
.InformationalVersion);

/// <summary>
/// BepInEx version without the build suffix.
/// </summary>
public static Version DisplayBepInExVersion { get; } =
new(BepInExVersion.Major, BepInExVersion.Minor, BepInExVersion.Patch, BepInExVersion.PreRelease);

/// <summary>
/// The path to the Managed folder that contains the main managed assemblies.
/// </summary>
Expand Down
9 changes: 3 additions & 6 deletions BepInEx.Preloader.Core/Logging/ChainloaderLogHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,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);

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,
Expand Down