Skip to content
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

Extracting 7z SFX files fails on linux #35

Open
chrisvigil opened this issue Jan 6, 2024 · 5 comments
Open

Extracting 7z SFX files fails on linux #35

chrisvigil opened this issue Jan 6, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@chrisvigil
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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.

@th3w1zard1 th3w1zard1 added the bug Something isn't working label Jan 17, 2024
@ProjectSynchro
Copy link

ProjectSynchro commented Apr 14, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants