th3w1zard1 / KOTORModSync

A flexible multi-mod installer for KOTOR games.
GNU General Public License v3.0
17 stars 0 forks source link

Extracting 7z SFX files fails on linux #35

Open chrisvigil opened 8 months ago

chrisvigil commented 8 months ago

Extracting 7z SFX files files fails on Linux.

When attempting to install Improved AI from the KOTOR2_Full.toml list instead of extracting Modified AI.exe in step 2 it attempts to open it in my default web browser.

My workaround was to extract Modified AI.exe with the 7z CLI application, repack it as a regular 7z and modify the install instructions.

KOTORModSync Version 1.0.2 OS: Arch Linux

th3w1zard1 commented 8 months ago

Yes, this is a known bug but it seems I've forgotten to post about it. Thanks for the reminder.

Realistically there's nothing I can do, the self-executable extractor is a Windows binary and won't open on Unix systems.

I have tried SharpCompress and tried building 7zip and packaging their .so/.dll/.dylib libs but those won't open self-extracting executables either.

You said the 7z cli works on linux for .exe sfx's? Could you show the exact commands you ran? If so I could package the 7z cli with kotormodsync's unix releases.

chrisvigil commented 8 months ago

It the same command as extracting any other 7z file: 7z x Modified\ AI.exe

I did some quick research now and Arch apparently used p7zip as it's 7z implementation which is provided by the p7zip-full package on Ubuntu. There is also the official 7z implementation (proved by 7zip on ubuntu) which i confirmed can also extract sfx's in the same way.

th3w1zard1 commented 8 months ago

So what I'm understanding is there's no singlecli binary I can package with ModSync that'll work on all of these different unix systems? It sounds like I'll need to do a few uname -s checks to determine what operating system the user is using and then use their package manager to install 7zip.

chrisvigil commented 8 months ago

No you should be fine including a binary for all linux systems and another for macOS The statically linked binary included with the official version should work best I think.

Either that or check for an installed binary and use that, both implementations appear to work the same way.

ProjectSynchro commented 5 months ago

So what I'm understanding is there's no singlecli binary I can package with ModSync that'll work on all of these different unix systems? It sounds like I'll need to do a few uname -s checks to determine what operating system the user is using and then use their package manager to install 7zip. Looking around to see if this can be easily done, I was reminded that Homebrew supports both macOS and Linux nowadays.

Looking at their 'sevenzip' package script: https://github.com/Homebrew/homebrew-core/blob/e9dd2b385f7a4c2b1b2fe6cf09469939df38f585/Formula/s/sevenzip.rb

It looks like they download upstream releases and use them there. The Linux x64 release is statically built, and the macOS one is a statically built universal binary.

See: https://7-zip.org/a/7z2403-linux-x64.tar.xz https://7-zip.org/a/7z2403-mac.tar.xz

EDIT: I also ran ldd to check what is linked to the linux binary , and it looks like it's very much a static binary: image