sign SMAPI on install to avoid new macOS security restrictions

This commit is contained in:
Jesse Plamondon-Willard
2024-11-27 19:47:50 -05:00
parent 015c510598
commit 72fb9248df
2 changed files with 16 additions and 0 deletions
+1
View File
@@ -5,6 +5,7 @@
* For players:
* Updated mod compatibility list.
* Fixed crash with some rare combinations of mods involving Harmony and mod APIs.
* Fixed compatibility with newer macOS security restrictions.
* For mod authors:
* Added `PathUtilities.CreateSlug` to turn an arbitrary string into a safe 'slug' that can be used in special contexts like URLs and file paths.
@@ -415,6 +415,21 @@ internal class InteractiveInstaller
}
}.Start();
}
// sign SMAPI on macOS
// This avoids 'StardewModdingAPI will damage your computer' errors in newer versions.
if (context.Platform is Platform.Mac)
{
new Process
{
StartInfo = new ProcessStartInfo
{
FileName = "codesign",
Arguments = $"--force --sign - \"{paths.UnixSmapiExecutablePath}\"",
CreateNoWindow = true
}
}.Start();
}
}
// copy the game's deps.json file