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

This commit is contained in:
ghorsington committed 2020-06-30 15:47:49 +03:00
1 parent 83b0f5e114
commit d566ac252c
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -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
View File
@@ -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");