Skip to content
Permalink
Browse files

Fixed patching chainloader breaking console title version; Fixed cons…

…ole title potentially not being set when using hard patcher
  • Loading branch information
ManlyMarco committed Nov 30, 2019
1 parent 8a65fc9 commit e0edca64dbe37609140abd02094ba50ad32a088e
Showing with 4 additions and 3 deletions.
  1. +4 −3 BepInEx/Bootstrap/Chainloader.cs
@@ -2,6 +2,7 @@
using BepInEx.Logging;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
@@ -99,7 +100,7 @@ public static void Initialize(string gameExePath, bool startConsole = true, ICol
// Temporarily disable the console log listener as we replay the preloader logs

var logListener = Logger.Listeners.FirstOrDefault(logger => logger is ConsoleLogListener);

if (logListener != null)
Logger.Listeners.Remove(logListener);

@@ -182,6 +183,7 @@ public static PluginInfo ToPluginInfo(TypeDefinition type)
}

private static readonly string CurrentAssemblyName = Assembly.GetExecutingAssembly().GetName().Name;
private static readonly Version CurrentAssemblyVersion = Assembly.GetExecutingAssembly().GetName().Version;

private static bool HasBepinPlugins(AssemblyDefinition ass)
{
@@ -213,8 +215,7 @@ public static void Start()
try
{
var productNameProp = typeof(Application).GetProperty("productName", BindingFlags.Public | BindingFlags.Static);
if (productNameProp != null)
ConsoleWindow.Title = $"BepInEx {Assembly.GetExecutingAssembly().GetName().Version} - {productNameProp.GetValue(null, null)}";
ConsoleWindow.Title = $"{CurrentAssemblyName} {CurrentAssemblyVersion} - {productNameProp?.GetValue(null, null) ?? Process.GetCurrentProcess().ProcessName}";

Logger.LogMessage("Chainloader started");

0 comments on commit e0edca6

Please sign in to comment.
You can’t perform that action at this time.