Ver código fonte

Remove use of Process.GetCurrentProcess() since it can fail on older monos on macOS

ghorsington 4 anos atrás
pai
commit
d566ac252c
2 arquivos alterados com 2 adições e 2 exclusões
  1. 1 1
      BepInEx.Preloader/Preloader.cs
  2. 1 1
      BepInEx/Bootstrap/Chainloader.cs

+ 1 - 1
BepInEx.Preloader/Preloader.cs

@@ -47,7 +47,7 @@ namespace BepInEx.Preloader
 				PreloaderLog = new PreloaderConsoleListener();
 				Logger.Listeners.Add(PreloaderLog);
 
-				string consoleTile = $"BepInEx {typeof(Paths).Assembly.GetName().Version} - {Path.GetFileNameWithoutExtension(Process.GetCurrentProcess().ProcessName)}";
+				string consoleTile = $"BepInEx {typeof(Paths).Assembly.GetName().Version} - {Paths.ProcessName}";
 
 				if (ConsoleManager.ConsoleActive)
 					ConsoleManager.SetConsoleTitle(consoleTile);

+ 1 - 1
BepInEx/Bootstrap/Chainloader.cs

@@ -231,7 +231,7 @@ namespace BepInEx.Bootstrap
 				var productNameProp = typeof(Application).GetProperty("productName", BindingFlags.Public | BindingFlags.Static);
 
 				if (ConsoleManager.ConsoleActive)
-					ConsoleManager.SetConsoleTitle($"{CurrentAssemblyName} {CurrentAssemblyVersion} - {productNameProp?.GetValue(null, null) ?? Path.GetFileNameWithoutExtension(Process.GetCurrentProcess().ProcessName)}");
+					ConsoleManager.SetConsoleTitle($"{CurrentAssemblyName} {CurrentAssemblyVersion} - {productNameProp?.GetValue(null, null) ?? Paths.ProcessName}");
 
 				Logger.LogMessage("Chainloader started");