Reloaded.Assembler icon indicating copy to clipboard operation
Reloaded.Assembler copied to clipboard

[Feature request] NativeAOT static linking improvements

Open NotNite opened this issue 8 months ago • 2 comments

Hi! I'm using Reloaded in a new project. It's built using NativeAOT and I'm currently statically linking all of my other dependencies with NativeLibrary/DirectPInvoke. Since this library uses FASM as a dynamic library, it needs to be present for the library to function, but that gets in the way of my goal of "distribute a single proxy DLL that can be dropped in a game folder".

Currently, I'm including FASM into the assembly as a resource and extracting it to the game directory before using Reloaded classes. This isn't a great solution, since the file gets left behind in the game install after uninstalling my mod, but it does work for my purpose of distributing a single file. My goal can be solved in two ways:

  • Allow a way to configure the path to the FASM DLL. Currently, this library looks in the process and assembly directory, but that's the same folder (the game folder) for me. I create a separate folder for user configs/logs, so I could extract the FASM DLL there and point this library to that file. Ends up with a cleaner game folder and an easier way to uninstall (just delete one file and clearly named folder), and it's much easier to implement, but it doesn't really solve the main problem (static linking support).
  • Directly support NativeAOT static linking by shipping the static libraries and having a way to toggle it on. I'm not entirely sure how static linking works for dependencies, or how to configure properties for dependencies at all, but it might be possible.

I'm under the impression that this library is mostly abandoned in favor of the Reloaded III Rust libraries, so I understand if it's not feasible/high priority to implement this right now.

Thanks!

NotNite avatar Apr 06 '25 17:04 NotNite