SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

[Vortex extension] uninstall generated files

Pathoschild opened this issue ยท 2 comments

commented

When Vortex uninstalls a mod, it only removes the files that were originally installed. This leaves the folder behind with any generated files like config.json, causing 'missing manifest' errors in SMAPI.

commented

For background, Vortex installs mods by storing the original mod archive, unzipping the mod into an internal folder (not visible to the game), and symlinking the files into the game folder. To uninstall the mod, it just removes the symlinks.

Per discussion with Tannin, the best way to handle generated files is to move them into that internal folder when the mod is disabled. That way they'll get removed automatically, and symlinked back in when the mod is re-enabled.

Notes from that discussion:

  • Vortex raises a mods-enabled event when mods are enabled/disabled, with two parameters: a list of affected mod IDs, and whether they were enabled (true) or disabled (false).
  • For example, the mod-dependency-management extension reacts to that event.
  • We can look at state.persistent.mods[gameId][modId].installationPath to get the mod's internal folder path. That's relative to the base install path, which can be accessed via selectors.installPath(state).
commented

Pickysaurus at Nexus is working on this, so I'll close this ticket.