From 377f824628c389213b224115f4c85ed5344c7775 Mon Sep 17 00:00:00 2001 From: ghorsington Date: Tue, 25 Jun 2019 19:35:47 +0300 Subject: [PATCH] Fix env vars not being set up early --- BepInEx.Preloader/Entrypoint.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BepInEx.Preloader/Entrypoint.cs b/BepInEx.Preloader/Entrypoint.cs index b4f76d6..e912e8a 100644 --- a/BepInEx.Preloader/Entrypoint.cs +++ b/BepInEx.Preloader/Entrypoint.cs @@ -9,8 +9,6 @@ namespace BepInEx.Preloader { public static void PreloaderMain(string[] args) { - EnvVars.LoadVars(); - string bepinPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetFullPath(EnvVars.DOORSTOP_INVOKE_DLL_PATH))); Paths.SetExecutablePath(args[0], bepinPath, EnvVars.DOORSTOP_MANAGED_FOLDER_DIR); @@ -50,6 +48,8 @@ namespace BepInEx.Preloader /// public static void Main(string[] args) { + EnvVars.LoadVars(); + // 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));