summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/release-notes.md1
-rw-r--r--src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs10
2 files changed, 11 insertions, 0 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 8043212e..0bbbeb58 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -10,6 +10,7 @@
## Upcoming release
* For players:
* When the installer is run from within a game folder, it now installs SMAPI to that folder. That simplifies installation if you have multiple copies of the game or it can't otherwise auto-detect the game path.
+ * Clarified not-a-mod error when the SMAPI installer is in the `Mods` folder.
## 3.7.6
Released 21 November 2020 for Stardew Valley 1.4.1 or later.
diff --git a/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs b/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs
index 6d6b6417..5eacee9e 100644
--- a/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs
+++ b/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs
@@ -112,10 +112,20 @@ namespace StardewModdingAPI.Toolkit.Framework.ModScanning
if (manifestFile == null)
{
FileInfo[] files = this.RecursivelyGetRelevantFiles(searchFolder).ToArray();
+
+ // empty folder
if (!files.Any())
return new ModFolder(root, searchFolder, ModType.Invalid, null, ModParseError.EmptyFolder, "it's an empty folder.");
+
+ // XNB mod
if (files.All(this.IsPotentialXnbFile))
return new ModFolder(root, searchFolder, ModType.Xnb, null, ModParseError.XnbMod, "it's not a SMAPI mod (see https://smapi.io/xnb for info).");
+
+ // SMAPI installer
+ if (files.Any(p => p.Name == "install on Linux.sh" || p.Name == "install on Mac.command" || p.Name == "install on Windows.bat"))
+ return new ModFolder(root, searchFolder, ModType.Invalid, null, ModParseError.ManifestMissing, "the SMAPI installer isn't a mod (you can delete this folder after running the installer file).");
+
+ // not a mod?
return new ModFolder(root, searchFolder, ModType.Invalid, null, ModParseError.ManifestMissing, "it contains files, but none of them are manifest.json.");
}