summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-01-09 22:52:40 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-02-07 22:40:39 -0500
commite3a0bd7e29e0e05bb574786268c30ff82dcc433d (patch)
tree326cd91e041df8b6b0421f72ec47ba650ac15fce
parent90c5858cf8a75a7f236a5fc58d23379e2116c482 (diff)
downloadSMAPI-e3a0bd7e29e0e05bb574786268c30ff82dcc433d.tar.gz
SMAPI-e3a0bd7e29e0e05bb574786268c30ff82dcc433d.tar.bz2
SMAPI-e3a0bd7e29e0e05bb574786268c30ff82dcc433d.zip
deprecate entry DLL with case-insensitive match
-rw-r--r--docs/release-notes.md1
-rw-r--r--src/SMAPI/Framework/ModLoading/ModResolver.cs15
2 files changed, 14 insertions, 2 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index 64f6368d..93e80266 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -17,6 +17,7 @@
* Fixed 'unknown mod' deprecation warnings showing the wrong stack trace.
* Fixed `e.Cursor` in input events showing wrong grab tile when player using a controller moves without moving the viewpoint.
* Fixed incorrect 'bypassed safety checks' warning for mods using the new `Specialised.LoadStageChanged` event in 2.10.
+ * Deprecated `EntryDll` values whose capitalisation don't match the actual file. (This works on Windows, but causes errors for Linux/Mac players.)
## 2.10.1
Released 30 December 2018 for Stardew Valley 1.3.32.
diff --git a/src/SMAPI/Framework/ModLoading/ModResolver.cs b/src/SMAPI/Framework/ModLoading/ModResolver.cs
index 835b0a54..a8564524 100644
--- a/src/SMAPI/Framework/ModLoading/ModResolver.cs
+++ b/src/SMAPI/Framework/ModLoading/ModResolver.cs
@@ -137,12 +137,23 @@ namespace StardewModdingAPI.Framework.ModLoading
}
// invalid path
- string assemblyPath = Path.Combine(mod.DirectoryPath, mod.Manifest.EntryDll);
- if (!File.Exists(assemblyPath))
+ if (!File.Exists(Path.Combine(mod.DirectoryPath, mod.Manifest.EntryDll)))
{
mod.SetStatus(ModMetadataStatus.Failed, $"its DLL '{mod.Manifest.EntryDll}' doesn't exist.");
continue;
}
+
+ // invalid capitalisation
+ string actualFilename = new DirectoryInfo(mod.DirectoryPath).GetFiles(mod.Manifest.EntryDll).FirstOrDefault()?.Name;
+ if (actualFilename != mod.Manifest.EntryDll)
+ {
+#if SMAPI_3_0_STRICT
+ mod.SetStatus(ModMetadataStatus.Failed, $"its {nameof(IManifest.EntryDll)} value '{mod.Manifest.EntryDll}' doesn't match the actual file capitalisation '{actualFilename}'. The capitalisation must match for crossplatform compatibility.");
+ continue;
+#else
+ SCore.DeprecationManager.Warn(mod.DisplayName, $"{nameof(IManifest.EntryDll)} value with case-insensitive capitalisation", "2.11", DeprecationLevel.Info);
+#endif
+ }
}
// validate content pack