Back up individual registry keys from Wine prefixes instead of whole *.reg file
What's your idea?
Right now, for games that are known to use registry saves, Ludusavi backs up the full system.reg, user.reg and userdef.reg files from Wine prefixes. It would be nice to back up individual keys/values, similar to how Ludusavi generates a registry.yaml file on Windows.
I've created a crate that can be used for this: Regashii, ~~although it doesn't currently preserve some of the special formatting that Wine reg files use (namely numbers after keys like [Software\\Wine\\Printing\\Spooler] 1128518253, and special options like #arch=win64)~~. I'll try to set up a Wine prefix for testing first.
Could you assign me to this? I'll give it a go with regashii.
Do you have any vision how you would like this feature to work as of now? Should windows and wine be combined into a generic code path?
That would be awesome, thank you!
I think the Windows and Wine registry handling are different enough that they should be separate code paths. My first thought would be to add a src/registry/wine.rs and integrate it in scan::scan_game_for_backup and GameLayout::restore. I'm open to other options/refactoring if you have an idea, though.
The most important thing is that we should be able to distinguish Wine registry data from different prefixes for the same game. Where each backup has a drive-{id} folder, we could add a wine-registry-{id} folder that has the same kind of nested structure, but where leaf files correspond to Wine *.reg files. In that case, mapping.yaml would need to store one hash for each of those files (like how it stores a single hash for the normal Windows registry), for detecting changes cheaply.
Officially, Wine recommends using its CLI tools to import registry changes, but I designed Regashii so that it should be able to modify Wine's reg files safely (although note that it doesn't preserve comments and some formatting).
It may also be worth keeping the existing behavior as a fallback, in case (for example) Wine ever introduces a new format that Regashii doesn't know how to handle yet.