Prechádzať zdrojové kódy

Use more accurate method of determining execution path

Bepis 6 rokov pred
rodič
commit
87cccb4b16
1 zmenil súbory, kde vykonal 2 pridanie a 1 odobranie
  1. 2 1
      BepInEx.Common/Utility.cs

+ 2 - 1
BepInEx.Common/Utility.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.IO;
 using System.Linq;
 using System.Reflection;
@@ -14,7 +15,7 @@ namespace BepInEx.Common
         /// <summary>
         /// The directory that the Koikatsu .exe is being run from.
         /// </summary>
-        public static string ExecutingDirectory => Path.GetDirectoryName(Environment.CommandLine);
+        public static string ExecutingDirectory => Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
 
         /// <summary>
         /// The path that the plugins folder is located.