I am trying to create a self extracting file for Windows from Ubuntu 10.04 using 7zip.

I tried these commands:

7zr -sfx7z.sfx a output.exe *.txt

7zr -sfx/usr/local/etc/7z.sfx a output.exe *.txt

Both show this error:

can't find specified sfx module

System error:

I have all the .sfx modules on /home/username/.sfx/ because I use them previously with "rar" and it worked fine, but it's not working for 7zip. I also copied 7z.sfx to /usr/local/etc/ to test the second command like shown here but I get the same error.

Why isn't it working?

3 Answers 3

PATH="/usr/lib/p7zip:$PATH" && 7z -sfx7zCon.sfx a ~/gnugpg.sfx ~/.gnupg/
  • This has worked like a charm. I've tried to locate the full string of the 7z.sfx module file and didn't work, and also tried to copy the file locally. Thank you.
    – m3nda
    Jun 5, 2015 at 22:38
  • This appears to generate an ELF executable, i.e. one that will not run on Windows.
    – Karu
    Oct 25, 2021 at 16:55

The SFX modules need to be in the same directory as the 7z executable. Don't ask why, there's no documentation on it. Good luck getting it to work though, because whenever I try and then run it I get a config file not found error.


please check that you use make all, then sh install.sh, instead of make, sh install.sh to install 7zip.

make depend   : to rebuild the makefile.depend
        make clean    : to clean all directories
        make          : to build bin/7za
        make sfx      : to build bin/7zCon.sfx (7za can now create SFX archive)
        make 7z       : to build bin/7z and its plugins :
                          - "bin/7z.so" (GNU LGPL + AES code license)
                          - "bin/Codecs/Rar29.so" (GNU LGPL + unRAR restriction)
        make 7zr      : to build bin/7zr
        make all      : to build bin/7za and bin/7zCon.sfx
        make all2     : to build bin/7za, bin/7z (with its plugins) and bin/7zCon.sfx
        make all3     : to build bin/7za, bin/7z (with its plugins), bin/7zr and bin/7zCon.sfx
        make test     : to test bin/7za (extracting, archiving, password ...)
        make test_7z  : to test bin/7z  (extracting, archiving, password ...)
        make test_7zr : to test bin/7zr (extracting, archiving, ...)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .