diff --git a/.gitmodules b/.gitmodules index 6079211f..362a8e01 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,7 +2,3 @@ path = HarmonyX url = https://github.com/ResoniteModding/HarmonyX.git branch = patchy -[submodule "Hardware.Info"] - path = Hardware.Info - url = https://github.com/ResoniteModding/Hardware.Info.git - branch = patchy diff --git a/Hardware.Info b/Hardware.Info deleted file mode 160000 index b0e99d8c..00000000 --- a/Hardware.Info +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b0e99d8c1eb2a5eb1e55efe144d38f47d52ec1c4 diff --git a/Runtimes/NET/BepisLoader/BepisLoader.cs b/Runtimes/NET/BepisLoader/BepisLoader.cs index a243b9d7..d0342e24 100644 --- a/Runtimes/NET/BepisLoader/BepisLoader.cs +++ b/Runtimes/NET/BepisLoader/BepisLoader.cs @@ -7,6 +7,7 @@ namespace BepisLoader; public class BepisLoader { internal static string resoDir = string.Empty; + private static readonly string tfmFolder = "net10.0"; internal static AssemblyLoadContext alc = null!; static void Main(string[] args) { @@ -18,6 +19,14 @@ static void Main(string[] args) alc = new BepisLoadContext(); + // Load System.Management explicitly for Windows to avoid PlatformNotSupportedException + var systemManagementPath = RuntimeInformation.RuntimeIdentifier.StartsWith("win") + ? new FileInfo(Path.Combine(resoDir, "runtimes", "win", "lib", tfmFolder, "System.Management.dll")) + : new FileInfo(Path.Combine(resoDir, "System.Management.dll")); + + if (systemManagementPath.Exists) + alc.LoadFromAssemblyPath(systemManagementPath.FullName); + // TODO: removing this breaks stuff, idk why AppDomain.CurrentDomain.AssemblyResolve += ResolveGameDll; diff --git a/Runtimes/NET/BepisLoader/BepisLoader.csproj b/Runtimes/NET/BepisLoader/BepisLoader.csproj index a2617df8..e5a7da5a 100644 --- a/Runtimes/NET/BepisLoader/BepisLoader.csproj +++ b/Runtimes/NET/BepisLoader/BepisLoader.csproj @@ -12,16 +12,6 @@ embedded - - - - - - - - - -