Mesen-S
Mesen-S copied to clipboard
Can't run from read-only directory
Even though I selected to place config files in the user directory, Mesen-S still tries to write to its own directory:
I've encountered it under Linux but I assume Mesen-S getting installed in "C:\Program Files" and then executed as non-administrator user would lead to the same error message.
This is because I've been unable to find a way on Linux to get Mono to load the C++ library from another folder than the one the Mesen-S.exe file is in (Mono doesn't appear to ever try loading the library from the process' current folder, unlike .NET). Because of this, the program has to extract the "libMesenSCore" library in the same folder as Mesen-S.exe itself.
Mind you the last time I took a look at this was 3 years ago when I first ported Mesen to Linux, so it's possible a solution exists and I just haven't found it yet.
Wait, Dependencies/libMesenSCore.x64.dll is a compressed version of libMesenSCore.dll? I simply copied the file with the new file name next to Mesen-S.exe and it appears to work (don't have a ROM at hand right now but the window loads).
Why place it in the Dependencies folder with the architecture in the file name in the first place?
Nothing in the Dependencies folder is meant to be "installed". Everything in the dependencies folder is zipped up, and that zip file is embedded into the Mesen-S.exe executable and either read directly from the embedded file or extracted to the disk at runtime.
It's meant to be a single-executable program that serves as both the "setup" and the program itself. In "official" builds, the executable contains both Windows and Linux DLLs for both x86 and x64, and only extracts the library needed based on the OS. (Though 32-bit currently doesn't work in Mesen-S due to some differences in how I've handled the interop wrapper vs Mesen)
It's meant to be a single-executable program that serves as both the "setup" and the program itself.
I don't see the benefit of this approach but maybe it's a Windows thing.
Anyway, I got Mesen-S successfully packaged for Linux (openSUSE, sadly no Fedora because llvm-gold isn't available there) in a traditional way – probably as good as its exotic setup permits.