Skip to content
Permalink
Browse files

Fix preloader crash in Unity 5 when getting process path

  • Loading branch information
denikson committed Nov 23, 2019
1 parent d527fd0 commit a35ec8d25cc81a8c1e8013d13725eb45d8c1ea32
Showing with 1 addition and 5 deletions.
  1. +1 −5 BepInEx.Preloader/Entrypoint.cs
@@ -56,7 +56,7 @@ public static void Main(string[] args)
{
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 @@ private static Assembly ResolveCurrentDirectory(object sender, ResolveEventArgs
}
}

private static string GetCurrentProcessDirectory()
{
return Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
}
}
}

0 comments on commit a35ec8d

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