-
-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Saner handling/overwriting of autodetected mods #949
Comments
Adding here for the moment, as closely related:
|
I know a lot of people who would benefit immensely from saner overwriting of autodetected mods. It gives so much headaches. |
How difficult would it be to do a CRC or SHA check on an AD, then compare to the same of a CKAN managed? If same, an option to convert AD to CKAN could be provided? It could reduce a barrier to usage by those who diligently maintain updates. Also, would it be difficult to just provide a option to complete convert? If a mod is detected as not compatible with 1.0.x, then it is left AD. Perhaps provide this as a CLI option only; that way if someone wants to do it they can do it, but it's all on the user (I'd use this.) |
The big challenge in identifying manually installed mods properly is that currently CKAN doesn't know anything about the actual files installed by a mod until it gets downloaded and installed. To be able to look at your GameData and spit out an accurate list of manually installed mods would require extracting all of that info out of the ZIP files and storing it somewhere. It could be a lot of new data to store and download (I'd ballpark it at an additional 58 MB using the below data model, where today's Performance could be challenging. Suppose I see a manually installed file at "installable_files": {
"GameData/ABCD/EFGH.cfg": {
"9C793B4F6E3352BF0387BD77CB7BED61150F8FB403D90D1F825ABA379EE3D57D": [
{
"name": "MyCoolMod",
"version": "v1.2.3"
},
...
]
},
...
}, Then there's the challenge of choosing between multiple available modules that install the same version of the same file (which is why my example above has an array associated with the hash rather than one object). Presumably we would have to try to use clues from the other installed files to determine which one is really installed, but that sounds like one of those complex AI-level tasks to me. In the end we might have to prompt the user to explain which one they really have installed. Assuming those problems could be solved, there are others. Users might choose to manually install mods that conflict with one another, and the registry would end up in an inconsistent state if they were simply imported as-is. We'd have to write a UI flow to resolve those conflicts. Seems like a lot of extra work just to let people skip the step of uninstalling mods manually. |
A few more observations:
To me, these factors all point toward centralizing this logic in a web service. The client could generate a JSON summary of what it sees in GameData, send it off to some ksp-ckan.space URL, and receive back the list of mods we think are present. This would remove all the excess data from the client where it's usually not needed, and the response times should still be about the same. Obviously there are downsides to that as well, such as having to run a web service. |
In my case I just hit this issue through having hit This kind of workflow is also necessary when dealing with development, and its painful to go from git installs of stuff like RealismOverhaul, RP-0, etc to wanting to follow CKAN after they are released. And generally this is wanted by people who have some degree of skill at it, but want an easier workflow than manually deleting all their mods and reinstalling from "scratch". The userbase which is asking for this is probably the kind of userbase who understands what state they're coming from and where they want to get to. |
Could you please file a new issue for this, @lamont-granquist? That sounds like something we could and should fix. |
This is showing up in GitHub searches for open issues despite being closed. |
When the CKAN project was first founded, we had the idea of "autodetected" mods that could satisfy dependencies, but not be managed by the client. At the time we had very few mods indexed, and the expectation was that users wouldn't want to uninstall their existing mods just to install them again via the CKAN.
Now things have changed. We have a lot of mods indexed, we have a lot of users, and many folks are exclusively using the CKAN for managing their mods.
We very much need a way to convert "autodetected" mods over to being first class CKAN mods, but this is a relatively hard process. We can't easily detect the version of a mod that the user has installed, and a user may have additional files that the CKAN wouldn't really know about.
For this to work properly, I believe the CKAN would be benefitted by a lot more filesystem awareness, as well as extensions to the spec to make sure we can transition mods correctly. In particular, I believe we need:
These two keywords are useful in their own right, by allowing mods to be upgraded with config intact, or to remove ephemeral files that should disappear during an upgrade. However they also pave the way for sane conversion of pre-installed mods. A migration may consist of:
This means we don't need to know the version of a mod we're coming from, but we can know the version of a mod we're going to.
Once we have a sane upgrade process in place, we can work towards removing autodetected mods entirely. Users with existing installs would be required to convert their mods to CKAN control if they were needed as dependencies.
This is all very much fraught with danger; in particular if one mod's metadata suggests it should delete files owned by another mod (which at least we can detect at install time).
Edit: Doing this would also make a fine time to examine the relationship between the
Module
andInstalledModule
classes internally, and if it still makes sense to have them separate.The text was updated successfully, but these errors were encountered: