CKAN icon indicating copy to clipboard operation
CKAN copied to clipboard

Ability to install directories and files into GameRoot directories

Open linuxgurugamer opened this issue 5 years ago • 5 comments

This is needed for the SoundtrackEditorForked (see KSP-CKAN/NetKAN#7666). It needs to put a few directories in the game root, as well as one directory/file into the KSP_Data/ (or KSP_x64_Data)

See also KSP-CKAN/NetKAN#5953, in which the original fork of this mod was found to be installed wrong and frozen.

linuxgurugamer avatar Feb 07 '20 19:02 linuxgurugamer

This was done deliberately to discourage installation of files into GameRoot:

https://github.com/KSP-CKAN/CKAN/pull/83#discussion_r19053307

image


Relevant bits of the spec:

  • GameRoot (which should be used sparingly, if at all).
  • A path to a given subfolder location can be specified only under GameData (v1.2);
  • Subfolder paths under a matched directory will be preserved, but directories will only be created when installing to GameData, Tutorial, or Scenarios.

HebaruSan avatar Feb 08 '20 16:02 HebaruSan

I see two clean solutions for this:

  1. Create a special handling for KSP_Data. For a stanza like "install_to": "KSP_Data/Mono" CKAN automatically decides based on which OS it is run on whether it should go into KSP_Data/Mono or KSP_x64_Data/Mono. This assumes the folder structure in this two directories is the same (I hope so).
  2. Create a os property. CKAN installs mods with this property set only if it matches the current OS (and always if it's not set at all).

DasSkelett avatar Feb 08 '20 17:02 DasSkelett

This mod's current release structure could not be indexed correctly anyway (same version number assigned to two different downloads for different game versions):

https://github.com/linuxgurugamer/SoundtrackEditorForked/releases/tag/4.6.1.2

image

image


Also the ZIP files appear to be misbuilt, every top level folder contains a copy of itself with duplicated contents:

image


Before we make any changes here, I think we should dig in and understand what this mod is doing and make sure that it has to be done this way.

Could these DLLs simply be installed to the root of GameRoot?

    {
      "find": "KSP_Data",
      "install_to": "GameRoot"
    },
    {
      "find": "KSP_x64_Data",
      "install_to": "GameRoot"
    },

For reference, AdvancedFlyByWire installs two DLLs directly into GameRoot in what looks like a similar situation:

https://github.com/KSP-CKAN/NetKAN/blob/master/NetKAN/AdvancedFlyByWire.netkan

    "install": [ {
        "file":       "SDL2.dll",
        "install_to": "GameRoot"
    }, {
        "file":       "SDL_LICENSE",
        "install_to": "GameRoot"
    }, {
        "file":       "XINPUTDOTNET_LICENSE",
        "install_to": "GameRoot"
    }, {
        "file":       "XInputInterface.dll",
        "install_to": "GameRoot"

And do these folders need to be in GameRoot, or could they be in GameData? It looks like Music contains audio assets used by the mod and Playlists contains some .cfg files, and it's not clear why those would need to live outside GameData.

    {
      "find": "Music",
      "install_to": "GameRoot"
    },
    {
      "find": "Playlists",
      "install_to": "GameRoot"
    }

HebaruSan avatar Feb 08 '20 19:02 HebaruSan

The reason for both the KSP_Data and KSP_x64_Data is to support Linux & Macs, which don't use the x64 folder. The intention is to only install one depending on the system, but I hadn't gotten that far.

Second, the DLLs need to be installed where they go because that is the only way they will work. I don't pretend to understand the reasons behind that right now.

Finally, the folders "Licenses". "Music", & "Playlists" could certainly be moved, if that was the only thing stopping this from being done.

This is actually a very old mod, and those folders are there because there wasn't a GameData directory when originally written. I have no problem rework that if requested and needed

linuxgurugamer avatar Feb 12 '20 03:02 linuxgurugamer

This would help with KerbalVR too!

JonnyOThan avatar Aug 16 '23 12:08 JonnyOThan