From 735893c1d5549915c2874a9e17dc1d9844408710 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 17 Jul 2021 18:52:06 -0400 Subject: add error if player manually installs wrong SMAPI bitness --- src/SMAPI.Toolkit/Framework/LowLevelEnvironmentUtility.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/SMAPI.Toolkit') diff --git a/src/SMAPI.Toolkit/Framework/LowLevelEnvironmentUtility.cs b/src/SMAPI.Toolkit/Framework/LowLevelEnvironmentUtility.cs index 8cbd8e51..be0c18ce 100644 --- a/src/SMAPI.Toolkit/Framework/LowLevelEnvironmentUtility.cs +++ b/src/SMAPI.Toolkit/Framework/LowLevelEnvironmentUtility.cs @@ -2,6 +2,7 @@ using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; +using System.Reflection; #if SMAPI_FOR_WINDOWS using System.Management; #endif @@ -48,7 +49,6 @@ namespace StardewModdingAPI.Toolkit.Framework } } - /// Get the human-readable OS name and version. /// The current platform. [SuppressMessage("ReSharper", "EmptyGeneralCatchClause", Justification = "Error suppressed deliberately to fallback to default behaviour.")] @@ -89,6 +89,13 @@ namespace StardewModdingAPI.Toolkit.Framework : "StardewValley.exe"; } + /// Get whether an executable is 64-bit. + /// The absolute path to the executable file. + public static bool Is64BitAssembly(string executablePath) + { + return AssemblyName.GetAssemblyName(executablePath).ProcessorArchitecture != ProcessorArchitecture.X86; + } + /********* ** Private methods -- cgit From db06291fdbc9a3e9f1afa65f6649e4671fff4756 Mon Sep 17 00:00:00 2001 From: bladeoflight16 <1159076+bladeoflight16@users.noreply.github.com> Date: Sat, 31 Jul 2021 15:30:27 -0400 Subject: Removing duplicate import of common.targets, eliminates several warnings --- src/SMAPI.Toolkit/SMAPI.Toolkit.csproj | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/SMAPI.Toolkit') diff --git a/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj b/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj index 8dc4d559..0e051c84 100644 --- a/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj +++ b/src/SMAPI.Toolkit/SMAPI.Toolkit.csproj @@ -19,6 +19,4 @@ - - -- cgit