I want to pack a folder containing various resources and executables into a single self-extracting file and execute a command after that, "setup.exe" for example. I've successfully accomplished that using 7-Zip's SFX module, using the "7zS.sfx" module that comes along the extra modules for 7-zip.

I am however doing most of my development on Linux, and I'd like to avoid running 7-zip under Wine if at all possible. It seems to me that 7-zip extras are only available for Windows, unless my search skills fail me. Is there a way to get those modules for Linux, or at least their source code and attempt to compile?


Solved it, I can simply 'cat' and produce a PE executable from Linux itself. Here goes:

# cat 7zS.sfx config.txt FILE.7z > FILE.exe

Where 7zS.sfx is the SFX file from the 'extras' 7-zip bundle, 'config.txt' is the configuration file as per documentation instructions and 'FILE.7z' is a 7-zip file produced using the native Linux p7z.


You can just use unrar in command line to extract the sfx packages OR rename the file to .rar extension and open it through the GUI compression/decompression packages that supports rar.

Hope you already know, but I am just posting for future reference,

unrar x filename.ext

You should have unrar installed on your linux box.

  • Do note that I want to pack files, not unpack them. Thanks for your time, anyway. – Felipe Scarel Aug 29 '14 at 15:52
  • I misunderstood your question. I was thinking you wanted to compress in Windows and extract the same in Linux! – jjk_charles Aug 29 '14 at 15:54

The right way to solve this would be to supply 7z with proper .sfx module which unfortunately isn't usually packed. Hence you'll have to manually download windows binary (32 or 64 bit depending on your target), extract it using smth like "7z x 7z1900.exe" (the binary itself is 7z sfx), take 7z.sfx file (N. B: name might change in future) and give it to your GNU/Linux 7z via command line option "7z -sfx7z.sfx ...".

That way you don't have to fiddle with config.txt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.