See the accompanying file LICENSE, version 2009-Jan-02 or later
(the contents of which are also included in unzip.h) for terms of use.
If, for some reason, all these files are missing, the Info-ZIP license
also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
unzipsfx.1 by Greg Roelofs
=========================================================================
define .EX/.EE (for multiline user-command examples; normal Courier font)
.... =========================================================================
=========================================================================
Note that self-extracting archives made with unzipsfx are no more (or less) portable across different operating systems than is the unzip executable itself. In general a self-extracting archive made on a particular Unix system, for example, will only self-extract under the same flavor of Unix. Regular unzip may still be used to extract the embedded archive as with any normal zipfile, although it will generate a harmless warning about extra bytes at the beginning of the zipfile. Despite this, however, the self-extracting archive is technically not a valid ZIP archive, and PKUNZIP may be unable to test or extract it. This limitation is due to the simplistic manner in which the archive is created; the internal directory structure is not updated to reflect the extra bytes prepended to the original zipfile.
=========================================================================
If unzipsfx is compiled with SFX_EXDIR defined, the following option is also enabled:
=========================================================================
See unzip(1L) for a more complete description of these options.
=========================================================================
(Support for regular ASCII text-conversion may be removed in future versions, since it is simple enough for the archive's creator to ensure that text files have the appropriate format for the local OS. EBCDIC conversion will of course continue to be supported since the zipfile format implies ASCII storage of text files.)
See unzip(1L) for a more complete description of these modifiers.
=========================================================================
=========================================================================
=========================================================================
.EX $AUTORUN$>[command line string]
When unzipsfx recognizes the ``$AUTORUN$>'' token at the beginning of the Zip archive comment, the remainder of the first line of the comment (until the first newline character) is passed as a shell command to the operating system using the C rtl ``system'' function. Before executing the command, unzipsfx displays the command on the console and prompts the user for confirmation. When the user has switched off prompting by specifying the -q option, autorun commands are never executed.
In case the archive comment contains additional lines of text, the remainder of the archive comment following the first line is displayed normally, unless quiet operation was requested by supplying a -q option.
=========================================================================
.EX cat unzipsfx letters.zip > letters chmod 755 letters zip -A letters
To create the same archive under MS-DOS, OS/2 or NT (note the use of the /b [binary] option to the copy command):
.EX copy /b unzipsfx.exe+letters.zip letters.exe zip -A letters.exe
Under VMS:
.EX copy unzipsfx.exe,letters.zip letters.exe letters == "$currentdisk:[currentdir]letters.exe" zip -A letters.exe
(The VMS append command may also be used. The second command installs the new program as a ``foreign command'' capable of taking arguments. The third line assumes that Zip is already installed as a foreign command.) Under AmigaDOS:
.EX MakeSFX letters letters.zip UnZipSFX
(MakeSFX is included with the UnZip source distribution and with Amiga binary distributions. ``zip -A'' doesn't work on Amiga self-extracting archives.) To test (or list) the newly created self-extracting archive:
.EX letters -t
To test letters quietly, printing only a summary message indicating whether the archive is OK or not:
.EX letters -tqq
To extract the complete contents into the current directory, recreating all files and subdirectories as necessary:
.EX letters
To extract all *.txt files (in Unix quote the `*'):
.EX letters *.txt
To extract everything except the *.txt files:
.EX letters -x *.txt
To extract only the README file to standard output (the screen):
.EX letters -c README
To print only the zipfile comment:
.EX letters -z
=========================================================================
Another problem with the current implementation is that any archive with ``junk'' prepended to the beginning technically is no longer a zipfile (unless zip(1) is used to adjust the zipfile offsets appropriately, as noted above). unzip(1) takes note of the prepended bytes and ignores them since some file-transfer protocols, notably MacBinary, are also known to prepend junk. But PKWARE's archiver suite may not be able to deal with the modified archive unless its offsets have been adjusted.
unzipsfx has no knowledge of the user's PATH, so in general an archive must either be in the current directory when it is invoked, or else a full or relative path must be given. If a user attempts to extract the archive from a directory in the PATH other than the current one, unzipsfx will print a warning to the effect, ``can't find myself.'' This is always true under Unix and may be true in some cases under MS-DOS, depending on the compiler used (Microsoft C fully qualifies the program name, but other compilers may not). Under OS/2 and NT there are operating-system calls available that provide the full path name, so the archive may be invoked from anywhere in the user's path. The situation is not known for AmigaDOS, Atari TOS, MacOS, etc.
As noted above, a number of the normal unzip(1L) functions have been removed in order to make unzipsfx smaller: usage and diagnostic info, listing functions and extraction to other directories. Also, only stored and deflated files are supported. The latter limitation is mainly relevant to those who create SFX archives, however.
VMS users must know how to set up self-extracting archives as foreign commands in order to use any of unzipsfx's options. This is not necessary for simple extraction, but the command to do so then becomes, e.g., ``run letters'' (to continue the examples given above).
unzipsfx on the Amiga requires the use of a special program, MakeSFX, in order to create working self-extracting archives; simple concatenation does not work. (For technically oriented users, the attached archive is defined as a ``debug hunk.'') There may be compatibility problems between the ROM levels of older Amigas and newer ones.
All current bugs in unzip(1L) exist in unzipsfx as well.
=========================================================================
=========================================================================
=========================================================================
=========================================================================