Nexus-Mods / Vortex

Vortex Development
GNU General Public License v3.0
900 stars 131 forks source link

[StardewValley] Updating any mod wipes the mod's config #15419

Open SoraHjort opened 6 months ago

SoraHjort commented 6 months ago

Describe the bug When ever you update a mod in Stardew Valley via Vortex, it will delete the config.json file that is within the mod's folder. Which means you have to reset the config options every time you install an update.

To Reproduce Steps to reproduce the behavior:

  1. See a mod that needs updating
  2. Update the mod
  3. Now the config file is gone

Expected behavior It should not be deleting the config files unless the updated mod specifically has a replacement file.

Platform (please complete the following information):

Additional context and info I would not think it'd be related but just on the off chance it comes up, Deployment Method is set to Move.

The wiping of config files have happened so much that I ended up with a powershell script that I run prior to doing updates that just backups every json file so that if I notice something changed I can just revert. But it's still quite annoying to have to do that.

If this is looked into to be fixed, the process can't also simply be setup to ignore config.json files, due to mods using sub directories to store additional farm/save file specific config files. Like the Happy Birthday mod stores it's per save info in the data folder with unique number IDs (the seed maybe? never looked into it) as the file name for the json file.

I would think idealy the method to go about it would be to see what files were in the pre-update archive to see which files have been procedurally generated (like the config files tend to be) and remove those before applying the update.

oliverrook commented 5 months ago

I can vouch for this. It is incredibly annoying. Even more annoying when that config is save dependent.

IDCs commented 5 months ago

With modType conflicts no longer being an issue, I think we can finally fix this issue.

We could do something similar to MO2 and save the config files in an "overhaul" merged mod; that way the config data gets saved regardless of mod updates.

IDCs commented 5 months ago

Hey there - @oliverrook, @SoraHjort - would you be willing to help us test an improvement which we hope will fix this issue?

We implemented an opt-in "configuration mod" functionality which intends to keep track of the config.json files for all mods located inside the game's mods folder. That way, if you re-install or update a mod, your configuration file will remain intact.

image

If you do opt to help us, we will ofc ensure that no damage is done to your setup.

Some things to note:

oliverrook commented 5 months ago

I would be willing to help test this, yes.

insomnious commented 4 months ago

@IDCs Wrap up a 0.3.0 archive to start sending and testing

IDCs commented 4 months ago

Hey @oliverrook,

Apologies for not responding sooner - we get so many github notifications, it's possible for us to miss ticket activity unless you tag us like my colleague did above.

Please find version 0.3.0 of the SDV extension below. game-stardewvalley-0.3.0.zip

I would prefer being present when you test the extension if possible, so that we can debug any issues that may come up during your tests, but it's really up to you. Just send me a friend request on Discord (nagev_)

Prep/Backup

Before we do anything we need to backup your config files and Vortex's state.

image

Extension installation

Once everything is safe and sound.

image

Extension usage

As mentioned in this ticket, the new config mod functionality is currently disabled by default and needs to be enabled, either through the settings page.

image

Or just by clicking the Sync mod configurations button.

image

You should now be able to install/update/enable/disable mods as you usually do and Vortex should be syncing any generated config.json files to the newly generated "Stardew Valley Mod Configuration" mod entry. It does this whenever you press the sync button, or whenever you deploy/purge your mods.

Recovery

If you wish to restore your environment to its previous state:

IDCs commented 2 months ago

@oliverrook, @SoraHjort - this functionality will never be released unless someone is willing to test it.

sammihere commented 1 week ago

@IDCs Can I help test? I'm having the same issue and would really like to see this released!

IDCs commented 1 week ago

Hey @sammihere, certainly, that would be great!

Have a look at the instructions I left for oliverrook and let me know if you encounter any issues.

Hey @oliverrook,

Apologies for not responding sooner - we get so many github notifications, it's possible for us to miss ticket activity unless you tag us like my colleague did above.

Please find version 0.3.0 of the SDV extension below. game-stardewvalley-0.3.0.zip

I would prefer being present when you test the extension if possible, so that we can debug any issues that may come up during your tests, but it's really up to you. Just send me a friend request on Discord (nagev_)

Prep/Backup

Before we do anything we need to backup your config files and Vortex's state.

  • For the state, open Vortex and go to the Settings Page -> Workarounds Tab -> Click on "Create backup" and save the state backup .json file somewhere safe.
  • If you have space to spare - I would backup your entire staging folder to ensure that all config.json files and any other changes are safe; alternatively if all you care about are the configuration files, you can open a PowerShell or cmd terminal inside your SDV staging/mods folder and run robocopy . "../ConfigBackup" /S config.* which will automatically find and backup your configuration files while maintaining the folder structure to ../ConfigBackup as seen in the snippet below.
image

Extension installation

Once everything is safe and sound.

  • Make sure Vortex is closed.
  • Go to your %appdata%/vortex/plugins directory and extract the contents of the zip file to its own folder as seen below
image
  • Start Vortex and confirm it's running version 0.3.0 of the extension via the extensions page

Extension usage

As mentioned in this ticket, the new config mod functionality is currently disabled by default and needs to be enabled, either through the settings page. image

Or just by clicking the Sync mod configurations button. image

You should now be able to install/update/enable/disable mods as you usually do and Vortex should be syncing any generated config.json files to the newly generated "Stardew Valley Mod Configuration" mod entry. It does this whenever you press the sync button, or whenever you deploy/purge your mods.

Recovery

If you wish to restore your environment to its previous state:

  • Purge your mods and remove/uninstall the "Stardew Valley Configuration Mod" before closing Vortex.
  • Delete the Stardew Valley extension from your %appdata%/vortex/plugins folder
  • If you backed up your configuration files using the command I recommended in the prep/backup stage, go to your SDV Staging/ConfigBackup folder and copy all of its contents over to SDV Staging/Mods
  • If you backed up the entire Staging folder - just delete the current staging folder and restore your backup.
  • Start-up Vortex - it may complain about mods being added or removed (depending on the changes you made while you were testing the new extension) - look carefully at the directories Vortex is mentioning and ensure that the changes are expected before hitting apply.
  • Ignore any errors that may be popping about invalid modTypes and go to Settings Page -> Workarounds Tab -> Click the Restore... button and browse to the state backup json file you created.
  • Vortex should now restart - hit deploy, and you should be back to your old modding environment.