SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

StardewModdingAPI.bin.osx can't be opened because it is from an unidentified developer on El Capitan OSX 10.11.6

007wayne opened this issue · 2 comments

commented

Every time the game is launched I have to allow StardewModdingAPI.bin.osx in System Preferences by entering my admin password.
After entering my admin password I can grant the following:
“StardewModdingAPI.bin.osx” is an application created by The Unarchiver. Are you sure you want to open it?

(The Unarchiver was used to extract unix-install.dat when I was troubleshooting this problem)

But the same thing happens again the next time I launch the game because StardewModdingAPI.bin.osx gets replaced by this command in the "StardewValley" bash script:
cp StardewValley.bin.osx StardewModdingAPI.bin.osx

I'm not sure why we must always replace StardewModdingAPI.bin.osx but i'm using the following code for now so that the file only gets copied if there's a new version or it's missing:

# refresh SMAPI if required
if [ -x StardewModdingAPI.bin.osx ]; then
    if ! cmp StardewValley.bin.osx StardewModdingAPI.bin.osx >/dev/null 2>&1; then
        cp -p StardewValley.bin.osx StardewModdingAPI.bin.osx
    fi
else
    cp -p StardewValley.bin.osx StardewModdingAPI.bin.osx
fi

A permanent change would obviously go in the "StardewModdingAPI" bash script of the SMAPI installer.

commented

Fixed in develop for the upcoming SMAPI 3.9.6. Thanks for reporting it!

I can't test on macOS myself, but here's the code I'm using if you want to confirm it works for you:

    # create bin file
    # Note: don't overwrite if it's identical, to avoid resetting permission flags
    if [ ! -x StardewModdingAPI.bin.osx ] || ! cmp StardewValley.bin.osx StardewModdingAPI.bin.osx >/dev/null 2>&1; then
        cp -p StardewValley.bin.osx StardewModdingAPI.bin.osx
    fi

    # launch SMAPI
    open -a Terminal ./StardewModdingAPI.bin.osx "$@"
commented