Skip to content

Comments

Mark virtual dependencies as auto-installed#4499

Merged
HebaruSan merged 1 commit intoKSP-CKAN:masterfrom
HebaruSan:feature/auto-inst-virt-dep
Jan 17, 2026
Merged

Mark virtual dependencies as auto-installed#4499
HebaruSan merged 1 commit intoKSP-CKAN:masterfrom
HebaruSan:feature/auto-inst-virt-dep

Conversation

@HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Jan 17, 2026

Problem / Motivation

  1. Install a mod with a virtual dependency (i.e., one in which the user is asked to choose which module to use to satisfy it)
  2. Pick whatever when prompted
  3. Finish installing
  4. The dependency is not marked as auto-installed, even though it is only there because another mod needed it and would probably make sense to remove if the user removes the depending mod

Cause

Virtual dependency choice is driven by a TooManyModsProvideKraken exception that halts the install. Then the UI prompts the user to choose, adds their choice to the changeset, and re-starts the install. So virtual dependencies are always in the changeset, making them appear as manual user choices. (xref #2753)

Changes

Now when the user chooses a mod to satisfy a virtual dependency, each UI adds the module to a list of mods that should be marked as auto-installed, which is passed to InstallList and Upgrade and used to set the autoInstalled parameter of Registry.RegisterModule.

Fixes #4428.

Caveats / Objections

I don't love adding a new parameter to InstallList and Upgrade for this, or making this common requirement live in UI-specific code. I anticipate a future project to:

  • Remove InstallList, Upgrade, and UninstallList from ModuleInstaller
  • Eliminate TooManyModsProvideKraken
  • Add a ModChange object to Core
  • Add an ApplyChanges to ModuleInstaller that:
    • has a parameter for a read only collection of ModChanges
    • has a parameter for a callback to choose a module to satisfy a virtual dependency
    • has its own list of auto-installed modules to which it adds such virtual dependencies

This would dramatically simplify the per-UI code for installing by better encapsulating the common/redundant logic in one place in Core.

... but that's a pretty big change, and for now this way of doing it is pretty minimal and safe and will serve as an anchor to ensure this feature is incorporated into that future rewrite, should it occur.

@HebaruSan HebaruSan added Enhancement New features or functionality Easy This is easy to fix GUI Issues affecting the interactive GUI Cmdline Issues affecting the command line Core (ckan.dll) Issues affecting the core part of CKAN Registry Issues affecting the registry Relationships Issues affecting depends, recommends, etc. ConsoleUI Issues affecting the interactive console UI labels Jan 17, 2026
@coveralls

This comment was marked as off-topic.

@HebaruSan HebaruSan merged commit 07b29fb into KSP-CKAN:master Jan 17, 2026
12 checks passed
@HebaruSan HebaruSan deleted the feature/auto-inst-virt-dep branch January 17, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cmdline Issues affecting the command line ConsoleUI Issues affecting the interactive console UI Core (ckan.dll) Issues affecting the core part of CKAN Easy This is easy to fix Enhancement New features or functionality GUI Issues affecting the interactive GUI Registry Issues affecting the registry Relationships Issues affecting depends, recommends, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mods that are installed as virtual dependencies aren't marked as auto-installed

2 participants