Pathoschild / SMAPI

The modding API for Stardew Valley.
https://smapi.io/
GNU Lesser General Public License v3.0
1.81k stars 258 forks source link

Loading XNB from mod folder on Mac fails with wrong path #278

Closed Pathoschild closed 7 years ago

Pathoschild commented 7 years ago

When you use the content API added in #257 to load an XNB in the game folder, it fails on MacOS with this error:

Microsoft.Xna.Framework.Content.ContentLoadException: Stardewponics failed loading content asset 'assets/greenhouse.xnb' from ModFolder.
---> Microsoft.Xna.Framework.Content.ContentLoadException: The content file was not found.
---> System.IO.FileNotFoundException: Content/../Mods/Stardewponics/assets/greenhouse.xnb
---> System.IO.DirectoryNotFoundException: Could not find a part of the path "/Applications/Stardew Valley.app/Contents/Resources/Mods/Stardewponics/assets/greenhouse.xnb".

Specifically, it's looking for the file in the wrong place:

File is at: /Applications/Stardew Valley.app/Contents/MacOS/Mods/Stardewponics/assets/greenhouse.xnb
Searched:   /Applications/Stardew Valley.app/Contents/Resources/Mods/Stardewponics/assets/greenhouse.xnb
miketweaver commented 7 years ago

Temporary fix: Open up terminal and go into the Stardew Valley.app location. (This may vary) ~$ cd /Applications/Stardew\ Valley.app/ Create a symlink to the Mods folder in the Resources folder: ~$ ln -s ../MacOS/Mods Contents/Resources/Mods

Pathoschild commented 7 years ago

For reference, here are the paths on MacOS (GOG version):

content: /Applications/Stardew\ Valley.app/Contents/Resources/Content/
game:    /Applications/Stardew\ Valley.app/Contents/MacOS/
Pathoschild commented 7 years ago

Fixed in develop for the next SMAPI release.