From 7bdf9be8f12751c5c2c528ea1c6857d6268e6fd9 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 22 Mar 2026 22:48:38 -0400 Subject: [PATCH] improve error when a mod is blocked by Windows Smart App Control --- docs/release-notes.md | 4 ++++ src/SMAPI/Framework/SCore.cs | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/docs/release-notes.md b/docs/release-notes.md index 15a04959..1933e182 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -1,6 +1,10 @@ ← [README](README.md) # Release notes +## Upcoming release +* For players: + * Improved error message when a mod is blocked by Windows Smart App Control. + ## 4.5.2 Released 14 March 2026 for Stardew Valley 1.6.14 or later. See [build attestation](https://github.com/Pathoschild/SMAPI/attestations/21366863). diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 036ec76c..e366c944 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -2144,6 +2144,12 @@ internal class SCore : IDisposable failReason = ModFailReason.Incompatible; return false; } + catch (FileLoadException ex) when (ex.Message.Contains("0x800711C7")) + { + errorReasonPhrase = "it was blocked by Windows Smart App Control (usually not a problem with the mod itself)"; + failReason = ModFailReason.LoadFailed; + return false; + } catch (SAssemblyLoadFailedException ex) { errorReasonPhrase = $"its DLL couldn't be loaded: {ex.Message}";