Skip to content

Description Files

WulfMarius edited this page Dec 21, 2018 · 10 revisions

Mods are added to the Mod-Installer by providing description files.
These files contain all information about the mod that are required to display, download and install them.

{
  "name": "Sample Mod",
  "url": "Sample mod website",
  "description": "Sample mod description",
  "author": "Sample mod author"
  "releases": ...,
  "definitions": ...,
}
  • name - This can either be the name of the mod (if all the releases belong to the same mod) or the name of the collection (if the description file contains releases from different mods).
  • url - This can either be the URL to a website providing more information or simply the location where the description file can be found.
  • description - A description for the mod or collection of releases.
  • releases - The releases of this description
  • definitions - The locations of other description files that are to be included.

Releases

Each individual release describes one version of a mod that can be downloaded and installed.
The releases in a description can all belong to the same mod or to different mods.

{
  "name": "Name of the release",
  "version": "Version of the release",
  "author": "Author of the release",
  "description: "Description of the release",
  "releaseDate": "2018-11-12",
  "compatibleWith": "V1.41",
  "changes": "Changes made in the release",
  "assets": ...,
  "dependencies": [
    {
      "name": "name of the first dependency",
      "version": "version of the first dependency"
    },
    {
      "name": "name of the second dependency",
      "version": "version of the second dependency"
    }
  ]
}
  • name - The name of the release
  • version - The version of the release (a semantic version, e.g. "1.4.2", leading "v" is allowed)
  • author - The author of the release
  • description - The description of the release.
  • releaseDate - The date when the release was created (ISO 8601 date, e.g. "2018-07-28")
  • compatibleWith - Optional Version of TLD that this release is compatible with. (See Compatibility Check)
  • changes - The changes made in the release.
  • assets - The assets of the release. Those are the individual files to be downloaded and installed.
  • dependencies - Optional The names and versions of other mods and libraries this release depends on.

Assets

{
  "url": "Download URL of the file",
  "targetDirectory": "Target directory for installation",
  "type": "The type of the file",
  "zipDirectory": "directory inside the zip file to be extracted"
}
  • url - The URL where the asset can be downloaded
  • targetDirectory - The directory where the file must be installed. This must be directory relative to "mods/". Absolute paths or paths that end up being outside of "mods/" are not support and cause the Mod-Installer to ignore this asset.
  • type - Can be used to denote the type of the file.
    "zip" will treat the asset like a zip file and try to extract its contents (using "zipDirectory", if provided).
    "file" will always just copy the file.
    If type is missing or empty, url will be used to decide (URLs ending in ".zip" will be extracted, other just copied).
    A zip file with "type": "file" will also just be copied and not extracted!
  • zipDirectory - The name of a directory inside the zip file to be extracted. If this is missing, the whole zip file will be extracted.
    Will be ignored, if the asset is not handled as zip file.

Definitions

"definitions": [
  "URL of another description file",
  "URL of yet another description file"
]

Definitions are URLs to other description files. Those description files will also be added when this description file is added to the Mod-Installer. This allows to create description files that bundle several other individual description files together and add them all in one step (e.g. all mods of an author).

Full Example

{
  "name": "Sample Mod",
  "url": "https://github.com/SampleAuthor/SampleMod",
  "description": "A sample mod to explain description files.",
  "author": "SampleAuthor",
  "releases": [
    {
      "name": "Sample Mod",
      "version": "1.0.0",
      "author": "SampleAuthor",
      "description": "A sample mod to explain description files.",
      "releaseDate": "2018-07-28",
      "changes": "Initial version",
      "dependencies": [
        {
          "name": "Infrastructure-Library",
          "version": "1.3.2"
        }
      ]
    },
    {
      "name": "Sample Mod",
      "version": "1.1.0",
      "author": "SampleAuthor",
      "description": "A sample mod to explain description files.",
      "releaseDate": "2018-11-12",
      "changes": "New feature X and lots of bug fixes.",
      "dependencies": [
        {
          "name": "Infrastructure-Library",
          "version": "1.3.2"
        },
        {
          "name": "My-Library",
          "version": "0.1.1"
        }
      ]
    }    
  ],
  "definitions": [
    "https://github.com/SampleAuthor/My-Library",
    "https://github.com/SampleAuthor/My-Other-Library"
  ]
}

Automatic Values

Some values are part of releases and the description itself, e.g. name, author, description.
If those values are omitted at a release, the corresponding value from the description is used instead.

This allows to define common values at the description level without having to repeat them for every release.
At the same time, a collection of releases from different mods can give each release its own description.

Clone this wiki locally