Explorar el Código

Fix preloader crash in Unity 5 when getting process path

ghorsington hace 5 años
padre
commit
a35ec8d25c
Se han modificado 1 ficheros con 1 adiciones y 5 borrados
  1. 1 5
      BepInEx.Preloader/Entrypoint.cs

+ 1 - 5
BepInEx.Preloader/Entrypoint.cs

@@ -56,7 +56,7 @@ namespace BepInEx.Preloader
 			{
 				EnvVars.LoadVars();
 
-				silentExceptionLog = Path.Combine(GetCurrentProcessDirectory(), silentExceptionLog);
+				silentExceptionLog = Path.Combine(Path.GetDirectoryName(args[0]), silentExceptionLog);
 
 				// Get the path of this DLL via Doorstop env var because Assembly.Location mangles non-ASCII characters on some versions of Mono for unknown reasons
 				preloaderPath = Path.GetDirectoryName(Path.GetFullPath(EnvVars.DOORSTOP_INVOKE_DLL_PATH));
@@ -91,9 +91,5 @@ namespace BepInEx.Preloader
 			}
 		}
 
-		private static string GetCurrentProcessDirectory()
-		{
-			return Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
-		}
 	}
 }