-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
Ability to install directories and files into GameRoot directories #2992
Comments
This was done deliberately to discourage installation of files into GameRoot: Relevant bits of the spec:
|
I see two clean solutions for this:
|
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 Also the ZIP files appear to be misbuilt, every top level folder contains a copy of itself with duplicated contents: 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"
} |
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 |
This would help with KerbalVR too! |
I assume there's not a big downside to installing both KSP_Data and KSP_x64_Data; though DasSkellet's proposal for a new install_to option would be nice. The Music and Playlists folders should definitely be moved into GameData (possibly under a PluginData folder if you don't want KSP to automatically load/process them) |
Hi @linuxgurugamer, has there been any progress on understanding this? |
So trying to install both directories to GameRoot didn't quite work, because it refuses to create subdirectories: https://github.com/KSP-CKAN/NetKAN/actions/runs/10081264830/job/27872895738?pr=10116 But we could let it through with just the x64 one, or use DasSkellet's idea. |
I've been looking into this a bit, and there are some complications here that call into question the viability of this suggestion:
At this point, finally cleaning up SoundTrackEditor (migrating from libmpg123 to some Unity API, moving the folders from game root to GameData like every other mod) is looking like a superior option to doing tons of confusing coding in CKAN to enable a bunch of hacks. |
Elaborating for future reference (only Windows DLLs seem to be included): |
"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." It doesn't hurt to install both, only one will be loaded. Probably given that the 32 bit code has been gone for a long time,could probably just install to the KSP_x64_Data, but that would require testing Second, the DLLs need to be installed where they go because that is the only way they will work. Essentially, that's on the OS, since we don't have access to the KSP source code (might even be Unity, not sure), we can't tell the game where to load the real DLLs (native code, not C# compiled code). However, if it's just a matter of the directories not being able to be created, I wouldn't mind modifying the soundtrack mod to put them somewhere else. |
If you're talking about support for non-Windows users, then no, that's wrong. Linux uses
Is that true, though? It sounds like so far nobody has actually tested this, and instead we've been going by guesses and assumptions; notably AdvancedFlyByWire is installing analogous files to game root and seems to work fine on Windows. I would really like to see at least some minimal effort put towards investigating whether this mod actually needs this feature before we add it. |
Well, you can, Principia does this. It's just more convenient to dump them somewhere that it's already loading things from (note that principia also spews benign imageformatexceptions when installed. Perhaps these could have been suppressed if they put the native libraries in PluginData, I'm not sure. What if we just changed these rules slightly?
That is, allow installing to KSP_x64_Data, KSP_Data, and whatever godforsaken place MacOS loads native libs from. CKAN should just install all of them as specified without trying to figure out what platform the game is actually running on. And yeah, strictly speaking, mods that only support windows don't need any new features at all from CKAN because they can just dump things into the game's root directory (I'm pretty sure it's a windows "feature" that the exe file's location automatically gets added to the library search path. I have no idea if Linux and MacOS do the same). |
Again, this fails when those directories are specified and don't already exist. |
Er, no? CKAN could create them? The game will ignore the ones that are for other OSes. |
Well now we're back to the core unanswered, surprisingly simple question: Is that actually needed? |
Admittedly I'm not an expert on DLLs, if Principia and ABFW can do it then obviously it's possible. Among other things, ABFW has different versions for each OS. Maybe just require that any mod that has OS specific files needs to have a separate install for each OS? |
It sounds like nobody's going to actually investigate this. If that does happen, and if the investigation indicates that these DLLs don't work when installed in game root, please let us know and we can re-open this. |
Right, I think a study of the use cases would be useful: SoundtrackEditorForkedUses libmpg123-0.dll. I'm fairly certain that since the file in KSP_Data is identical to the one in KSP_x64_Data, it doesn't actually work on linux. There are builds of this library available for linux, but we don't know if the mod just works by replacing that file. So, right now, we can assume that this mod is effectively windows-only. Kerbal-VRUses native openvr dlls, only ships with windows versions. Like libmpg, there should be versions of these libraries available for other operating systems but no one has asked for them. As such, effectively windows-only. AFBWUses SDL and XInput. Dumps native libraries into GameRoot. The windows flavor also contains XInputDotNetPure.dll inside the mod's GameData folder (presumably this is a manged DLL interface to XInput? No idea what it would do if installed on linux). Has alternative download for linux: does not include native windows libraries nor the XInputDotNetPure.dll. The mod's manged dll is also not bitwise identical but I don't know if there's actually any differences in the code. According to documentation, requires that the user manually installs SDL on their system. PrincipiaDoes their own thing by dumping native libraries for all 3 platforms into their GameData folder and manually loads them as appropriate. Spews benign BadImageFormatExceptions as KSP's assembly loader tries and fails to load them. Craft2FBX (unreleased)Uses UnityFbxSdkNative. Seems like there is a build of this available at least for mac, not sure about linux. But I don't have a way to test or support them, so effectively windows-only. So, it's probably fine for windows-only mods to just continue dumping DLLs into GameRoot. If Principia ever wants to integrate with CKAN or if one of the above mods wants to actively support a non-windows OS we should revisit this. |
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.
The text was updated successfully, but these errors were encountered: