This would be a small program in the Spring installation which would be associated with the .sdz and .sd7 file types. If it was launched on such a file (open instead of save as in browser, double click on it on desktop, etc.), it'd install it to the right subfolder of the Spring install folder.
It should be really minimalistic IMHO:
- Written in C/C++, to not introduce enduser dependencies on other runtimes for a small tool like this.
- Preferably it should be possible to compile it with MinGW (but of course MSVC++ (Express Edition) can be used to make it).
- It is started with one argument, the full path to a .sdz or .sd7 file.
- It should examine the file.
- If it is a map, it should put it in the Spring's maps folder. It can find this folder because it is stored in Spring's folder itself, so it can extract the path from the commandline it was invoked with (the 0th argument).
- If it is a mod, it should put it in the Spring's mods folder.
- It should then give a message box "The mod/map blabla has been saved succesfully to <path>, use the reload mods/maps button in the lobby to make Spring find it."
Then it may be possible to just use the unitsync functions for retrieving maps and mods, or otherwise coding up something using the VFS functions in there, mimicking the code to determine whether something is a map/mod in ArchiveScanner.cpp (probably the tool should do nothing if a file is both map AND mod).
When the tool is finished one needs to figure out how to put the right registry key creation code in the installer to associate this tool with .sdz and .sd7 if they aren't associated with another program yet.
Bonus points if it works in Linux too, including the necessary .desktop files for file associations in Gnome/KDE. This would require some trickery with the multiple data directory code however.
I post this here knowing someone can pick it up more easily if it's clearer what is wanted and how it may be implemented
