Sharing a modlist (metapackages) - KSP-CKAN/CKAN GitHub Wiki

You can use CKAN to share your list of installed mods with another user by using metapackages.

As a standard CKAN generates a metapackage of all your installed mods in .../<KSP root directory>/CKAN/installed-<instance name>.ckan. If you want to share your mod list with someone or take a snapshot of the stuff you have installed right now for a given KSP installation, you can copy that file and share/keep it.

Creating a custom metapackage

The easy way (recommended)

  1. Install the mods you want your metapackage to contain
  2. In the CKAN client click File → Export modpack...
  3. Customize your modpack's metadata in the editable fields
  4. Click Export to save

The custom handcrafted way

Metapackages are much like normal .ckan files but do not have a download property and have an added:

    "kind": "metapackage",

Metapackages depend on other mods rather than defining the installation of a specific mod from a specific place.

NOTE: Metapackage support was added in CKAN 1.6.0 so spec_version must always be at least v1.6! The "Export modpack" option uses spec_version v1.18 to allow Unlicense to be chosen as the license.

A metapackage that installs FAR, KER and KAC looks like this:

{
    "spec_version": "v1.6",
    "identifier":   "YourMetapackageName",
    "name":         "User friendly name of your metapackage",
    "abstract":     "A short description of the metapackage",
    "version":      "1",
    "license":      "unknown",
    "kind":         "metapackage",
    "depends": [
        {
            "name": "FerramAerospaceResearch",
        },
        {
            "name": "KerbalEngineerRedux",
        },
        {
            "name": "KerbalAlarmClock",
        }
    ]
}

The "name" field must be set to the identifier of the relevant module. If you don't know a module's identifier, select it in GUI and check the "Identifier" field in the mod info pane on the right side.

Metapackages will solve dependencies for mods within them. The above example also installs ModuleManager since FAR depends on it.

You can validate your file online with http://www.jsonschemavalidator.net/ (Schema: SchemaStore.org -> KSP-CKAN)

Expanding your custom metapackage

Apart from doing a monolithic install of a list of mods you can add choices using the "recommends" and "suggests" keywords. Recommendations default to checked and the user will have to uncheck those they don't want. Suggestionss start un-check and the user must check those they want.

Keeping the earlier example we add in recommendations for Deadly Reentry and Intake Build aid as well as suggestions for B9 and Firespitter. The metapackage would then look like this:

{
    "spec_version": "v1.6",
    "identifier":   "YourMetapackageName",
    "name":         "User friendly name of your metapackage",
    "abstract":     "A short description of the metapackage",
    "version":      "1",
    "license":      "unknown",
    "kind":         "metapackage",
    "depends": [
        {
            "name": "FerramAerospaceResearch",
        },
        {
            "name": "KerbalEngineerRedux",
        },
        {
            "name": "KerbalAlarmClock",
        }
    ],
    "recommends": [
        {
            "name": "DeadlyReentry"
        },
        {
            "name": "IntakeBuildAid"
        }
    ],
    "suggests":[
        {
            "name": "B9"
        },
        {
            "name": "Firespitter"
        }
    ]
}

The "name" field works the same for recommendations and suggestions as it does for regular dependencies (i.e., it must be set to the module's identifier).

Installing a metapackage

GUI

  1. Click File → Install from .ckan
  2. A dialog window opens where you select your <metapackage>.ckan and then click "Open"
  3. Installation will ensue just like when installing other mods through CKAN

Command line

Installing a metapackage through the command line is done via the following command

ckan install -c path/to/metapackage.ckan