summaryrefslogtreecommitdiff
path: root/src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-08-24 21:59:52 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-08-25 18:25:17 -0400
commitf8c76bde39ba2afb11540c9af5d88aad4c73f789 (patch)
treee27d552daeb113bc069bed0400b25a96ce2ba85c /src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs
parente1d8838587329bd64f3627c4cdc4ac57d187ad7f (diff)
downloadSMAPI-f8c76bde39ba2afb11540c9af5d88aad4c73f789.tar.gz
SMAPI-f8c76bde39ba2afb11540c9af5d88aad4c73f789.tar.bz2
SMAPI-f8c76bde39ba2afb11540c9af5d88aad4c73f789.zip
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.
Diffstat (limited to 'src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs')
-rw-r--r--src/SMAPI.Toolkit/Utilities/EnvironmentUtility.cs7
1 files changed, 7 insertions, 0 deletions
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());
}
+
+ /// <summary>Get whether an executable is 64-bit.</summary>
+ /// <param name="path">The absolute path to the assembly file.</param>
+ public static bool Is64BitAssembly(string path)
+ {
+ return LowLevelEnvironmentUtility.Is64BitAssembly(path);
+ }
}
}