On one specific thing:
What you say about 'information about which files (and folders) are associated with which mod' is pure convention, used by modder, not a 'tp2 weidu mod specification', right?
Not really. By definition, a mod is a bunch of files distributed as a whole. Files are in the mod iff they're in the distribution. (If someone else writes a mod called "spear castle stratagems" which also has a "stratagems" folder, what determines whether a given file in 'stratagems' is part of my mod or part of theirs is: was it in my distribution, or theirs?) That distribution information is erased if multiple distributions are combined into a single folder.
This is extreme case when two authors and each of them created a mod which contains: 'setup-spells.tp2' and 'spells' directory with 'spell.spl' file. It is still possible. Yet, even if I will extract two identical mods from different authors into two separate directory, it won't prevent overwriting them after coping to the gamedir. Even sequencing them (copy modA, install modA, copy modA from another dir, install modA) won't prevent overwriting the same files inside 'override' directory. I was under impression that the community agree to use "reserved prefixes" in order to avoid such situation. Are you implicating that a mod manager should have a design which prevent such situation?
Perhaps I'm misunderstanding the context. But as far as I can see, one way or another any management program has to get hold of the actual content of the mod. It's then just a question of whether that program (a) saves the content into one big folder shared by every mod, or (b) saves the content into a bespoke folder. If you don't have access to the mod's tp2 name in advance, just get your tool to rename the folder after opening it, or else make a lookup table with entries like 'setup-stratagems.tp2=folder0009' (it doesn't need to be sophisticated, plain text will do).
I'm greatfull for you feedback so let me share some more info:
At the begging, my app was simply scanning tp2 files, parse and save the special 'basename' without 'setup-' and extension and use it as a value as a folder name which is required to copy (if it's directly or one level above). So I'm associating "mymod.tp2" with "mymod" folder but I'm not relaying on the data from player (pointing to a top-level dir) or even a mod package (extraction to custom dir, then renaming). I'm relaying on the tp2 data from extracted mods. The life was nice and easy.
Then the "Worldmap" mod comes with "bp-bgt
_worldmap" instead of "bp-bgt
-worldmap" and break it into pieces. I didn't wanted to even try asking about 'adopting a mod to mod manager' so I use BACKUP from tp2 which solve this problem. The life was nice and easy, I could focus on other things. Then, you came and introduce "immutable" mod design which change "BACKUP" to some random path, which I can't process/relay anymore. I can't blame you, you are doing what's best for you mod, I didn't even try to ask you about changing it. And adding custom code to cover a mod (like BWS did) is not an option. So here we are.
You suggested solution relays on either player pointing to a correct top-level dir (after he extracted mod package) or the assumption that the mod package will not have any extra top-level directories. It's too prone to mistakes from both modders and players.
As for "not blaming player", I don't really know what you mean, but (I take it) we're talking about how an automated program handles its data organization. If so, it doesn't need to do it in any very human-readable way. (If we're just talking about how someone manually organizes their own mod collection, there's no problem in any case.)
My goal was to:
-not relay on extracting archives (instead copy mod files and folders) in order to allow players to add translations/local fixes and delta updates (long story for other time) because extraction overwrite files
-not impose any special place where player extracts all mods (let's assume that they don't overwrite each other by following community rules about prefixes)
It should be perfectly fine for a player to have such folder structure:
D:\MyAllWeiduMods\AI\<extractedmods>
D:\MyAllWeiduMods\NPC\<extractedmods>
D:\MyAllWeiduMods\Quests\<extractedmods>
D:\MyAllWeiduMods\Tweaks\<extractedmods>
D:\MyAllWeiduMods\SomeRandomFolderName\AndAnotherOne\<extractedmods>
-at the same time, allow a mod manager to copy
only selected mods to gamedir and install it
All what I wanted was working fine, when I relay on BACKUP keyword data. But now, when even BACKUP can be anything, I can't even relay on BACKUP anymore. So it's impossible to cover 100% of mods and allow such flexibility for the players. Either I will require some special folder design or filling some info. And I don't want to mainly because I believe that we can create a new design which will allow for all of this. I'm pointing at this because I want people to be aware and I want to look for a solution which will allows for what I want and be 100% foolproof. Or atleast better than current tp2.