*** Welcome to piglix ***

Self-extracting archive


A self-extracting archive (SFX) is a computer executable program which contains compressed data in an archive file combined with machine-executable program instructions to extract this information on a compatible operating system and without the necessity for a suitable extractor to be already installed on the target computer. The executable part of the file is known as the stub and the non-executable part the archive.

One executing a self-extracting archive under an operating system which supports it, the archive contents are extracted. Non-self-extracting archives contain the data files only and therefore need to be extracted with a compatible program. Self-extracting archives cannot self-extract under a different operating system but can still be opened with a suitable extractor as this tool will disregard the executable part of the file and instead extract only the archive resource.

For example, an archive may be called somefiles.zip - it can be opened under any operating system by a suitable archive manager which supports both the file format and compression algorithm used. It could alternatively be converted into somefiles.exe which will self-extract on a machine running Microsoft Windows without the need for that suitable archive manager. It will not self-extract under Linux, but can be opened with a suitable Linux archive manager.

There are several functionally equivalent but incompatible archive file formats, including ZIP, RAR, 7z and many others. Some programs can manage (create, extract, or modify) only one type of archive whilst many others can handle multiple formats. There is additionally a distinction between the file format and compression algorithm used. A single file format, such as 7z, can support multiple different compression algorithms including LZMA, LZMA2, PPMd and BZip2. For a decompression utility to correctly expand an archive of either the self-extracting or standard variety, it must be able to operate on both the file format and algorithm used. The exact executable code placed at the beginning of a self-extracting archive may therefore need to be varied depending on what options were used to create the archive. The decompression routines will be different for a LZMA 7z archive when compared with a LZMA2 7z archive, for example.


...
Wikipedia

...