From f8c76bde39ba2afb11540c9af5d88aad4c73f789 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Tue, 24 Aug 2021 21:59:52 -0400 Subject: add 64-bit compatibility check before loading mods That reduces time spent trying to rewrite them (which won't work anyway), and shows a more informative message than the default 'DLL couldn't be loaded' error. --- src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs') diff --git a/src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs b/src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs index 62bd13cd..6de79a85 100644 --- a/src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs +++ b/src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs @@ -46,5 +46,12 @@ namespace StardewModdingAPI.Toolkit.Utilities { return LowLevelEnvironmentUtility.GetExecutableName(platform.ToString()); } + + /// Get whether an executable is 64-bit. + /// The absolute path to the assembly file. + public static bool Is64BitAssembly(string path) + { + return LowLevelEnvironmentUtility.Is64BitAssembly(path); + } } } -- cgit