|
@@ -8,11 +8,11 @@ namespace BepInEx.Preloader
|
|
|
{
|
|
|
internal static class PreloaderRunner
|
|
|
{
|
|
|
- public static void PreloaderMain(string[] args)
|
|
|
+ public static void PreloaderMain()
|
|
|
{
|
|
|
string bepinPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetFullPath(EnvVars.DOORSTOP_INVOKE_DLL_PATH)));
|
|
|
|
|
|
- Paths.SetExecutablePath(args[0], bepinPath, EnvVars.DOORSTOP_MANAGED_FOLDER_DIR);
|
|
|
+ Paths.SetExecutablePath(EnvVars.DOORSTOP_PROCESS_PATH, bepinPath, EnvVars.DOORSTOP_MANAGED_FOLDER_DIR);
|
|
|
AppDomain.CurrentDomain.AssemblyResolve += LocalResolve;
|
|
|
Preloader.Run();
|
|
|
}
|
|
@@ -58,7 +58,7 @@ namespace BepInEx.Preloader
|
|
|
{
|
|
|
EnvVars.LoadVars();
|
|
|
|
|
|
- silentExceptionLog = Path.Combine(Path.GetDirectoryName(args[0]), silentExceptionLog);
|
|
|
+ silentExceptionLog = Path.Combine(EnvVars.DOORSTOP_PROCESS_PATH, 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));
|
|
@@ -69,7 +69,7 @@ namespace BepInEx.Preloader
|
|
|
// To prevent that, we have to use reflection and a separate startup class so that we can install required assembly resolvers before the main code
|
|
|
typeof(Entrypoint).Assembly.GetType($"BepInEx.Preloader.{nameof(PreloaderRunner)}")
|
|
|
?.GetMethod(nameof(PreloaderRunner.PreloaderMain))
|
|
|
- ?.Invoke(null, new object[] { args });
|
|
|
+ ?.Invoke(null, null);
|
|
|
|
|
|
AppDomain.CurrentDomain.AssemblyResolve -= ResolveCurrentDirectory;
|
|
|
}
|