.\" Copyright (c) 1990-2005 Info-ZIP. All rights reserved. .\" .\" See the accompanying file LICENSE, version 2000-Apr-09 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) .de EX .in +4n .nf .ft CW .. .de EE .ft R .fi .in -4n .. .\" ========================================================================= .TH UNZIPSFX 1L "28 February 2005 (v5.52)" "Info-ZIP" .SH NAME unzipsfx \- self-extracting stub for prepending to ZIP archives .PD .SH SYNOPSIS \fB\fP [\fB\-cfptuz\fP[\fBajnoqsCLV$\fP]] [\fIfile(s)\fP\ .\|.\|. [\fB\-x\fP\ \fIxfile(s)\fP\ .\|.\|.]] .PD .\" ========================================================================= .SH DESCRIPTION \fIunzipsfx\fP is a modified version of \fIunzip\fP(1L) designed to be prepended to existing ZIP archives in order to form self-extracting archives. Instead of taking its first non-flag argument to be the zipfile(s) to be extracted, \fIunzipsfx\fP seeks itself under the name by which it was invoked and tests or extracts the contents of the appended archive. Because the executable stub adds bulk to the archive (the whole purpose of which is to be as small as possible), a number of the less-vital capabilities in regular \fIunzip\fP have been removed. Among these are the usage (or help) screen, the listing and diagnostic functions (\fB\-l\fP and \fB\-v\fP), the ability to decompress older compression formats (the ``reduce,'' ``shrink'' and ``implode'' methods). The ability to extract to a directory other than the current one can be selected as a compile-time option, which is now enabled by default since UnZipSFX version 5.5. Similary, decryption is supported as a compile-time option but should be avoided unless the attached archive contains encrypted files. Starting with release 5.5, another compile-time option adds a simple ``run command after extraction'' feature. This feature is currently incompatible with the ``extract to different directory'' feature and remains disabled by default. .PP \fBNote that self-extracting archives made with\fP \fIunzipsfx\fP \fBare no more (or less) portable across different operating systems than is the\fP \fIunzip\fP \fBexecutable itself.\fP 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 \fIunzip\fP 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. \fIDespite this\fP, however, the self-extracting archive is technically \fInot\fP 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. .PD .\" ========================================================================= .SH ARGUMENTS .IP [\fIfile(s)\fP] An optional list of archive members to be processed. Regular expressions (wildcards) similar to those in Unix \fIegrep\fP(1) may be used to match multiple members. These wildcards may contain: .RS .IP * matches a sequence of 0 or more characters .IP ? matches exactly 1 character .IP [.\|.\|.] matches any single character found inside the brackets; ranges are specified by a beginning character, a hyphen, and an ending character. If an exclamation point or a caret (`!' or `^') follows the left bracket, then the range of characters within the brackets is complemented (that is, anything \fIexcept\fP the characters inside the brackets is considered a match). .RE .IP (Be sure to quote any character that might otherwise be interpreted or modified by the operating system, particularly under Unix and VMS.) .IP [\fB\-x\fP\ \fIxfile(s)\fP] An optional list of archive members to be excluded from processing. Since wildcard characters match directory separators (`/'), this option may be used to exclude any files that are in subdirectories. For example, ``\fCfoosfx *.[ch] -x */*\fR'' would extract all C source files in the main directory, but none in any subdirectories. Without the \fB\-x\fP option, all C source files in all directories within the zipfile would be extracted. .PP If \fIunzipsfx\fP is compiled with SFX_EXDIR defined, the following option is also enabled: .IP [\fB\-d\fP\ \fIexdir\fP] An optional directory to which to extract files. By default, all files and subdirectories are recreated in the current directory; the \fB\-d\fP option allows extraction in an arbitrary directory (always assuming one has permission to write to the directory). The option and directory may be concatenated without any white space between them, but note that this may cause normal shell behavior to be suppressed. In particular, ``\fC\-d\ ~\fR'' (tilde) is expanded by Unix C shells into the name of the user's home directory, but ``\fC\-d~\fR'' is treated as a literal subdirectory ``\fB~\fP'' of the current directory. .PD .\" ========================================================================= .SH OPTIONS \fIunzipsfx\fP supports the following \fIunzip\fP(1L) options: \fB\-c\fP and \fB\-p\fP (extract to standard output/screen), \fB\-f\fP and \fB\-u\fP (freshen and update existing files upon extraction), \fB\-t\fP (test archive) and \fB\-z\fP (print archive comment). All normal listing options (\fB\-l\fP, \fB\-v\fP and \fB\-Z\fP) have been removed, but the testing option (\fB\-t\fP) may be used as a ``poor man's'' listing. Alternatively, those creating self-extracting archives may wish to include a short listing in the zipfile comment. .PP See \fIunzip\fP(1L) for a more complete description of these options. .PD .\" ========================================================================= .SH MODIFIERS \fIunzipsfx\fP currently supports all \fIunzip\fP(1L) modifiers: \fB\-a\fP (convert text files), \fB\-n\fP (never overwrite), \fB\-o\fP (overwrite without prompting), \fB\-q\fP (operate quietly), \fB\-C\fP (match names case-insensitively), \fB\-L\fP (convert uppercase-OS names to lowercase), \fB\-j\fP (junk paths) and \fB\-V\fP (retain version numbers); plus the following operating-system specific options: \fB\-X\fP (restore VMS owner/protection info), \fB\-s\fP (convert spaces in filenames to underscores [DOS, OS/2, NT]) and \fB\-$\fP (restore volume label [DOS, OS/2, NT, Amiga]). .PP (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.) .PP See \fIunzip\fP(1L) for a more complete description of these modifiers. .PD .\" ========================================================================= .SH "ENVIRONMENT OPTIONS" \fIunzipsfx\fP uses the same environment variables as \fIunzip\fP(1L) does, although this is likely to be an issue only for the person creating and testing the self-extracting archive. See \fIunzip\fP(1L) for details. .PD .\" ========================================================================= .SH DECRYPTION Decryption is supported exactly as in \fIunzip\fP(1L); that is, interactively with a non-echoing prompt for the password(s). See \fIunzip\fP(1L) for details. Once again, note that if the archive has no encrypted files there is no reason to use a version of \fIunzipsfx\fP with decryption support; that only adds to the size of the archive. .PD .\" ========================================================================= .SH AUTORUN COMMAND When \fIunzipsfx\fP was compiled with CHEAP_SFX_AUTORUN defined, a simple ``command autorun'' feature is supported. You may enter a command into the Zip archive comment, using the following format: .PP .EX $AUTORUN$>[command line string] .EE .PP When \fIunzipsfx\P 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, \fIunzipsfx\P displays the command on the console and prompts the user for confirmation. When the user has switched off prompting by specifying the \fB-q\fP option, autorun commands are never executed. .PP In case the archive comment contains additonal lines of text, the remainder of the archive comment following the first line is displayed normally, unless quiet operation was requested by supplying a \fB-q\fP option. .PD .\" ========================================================================= .SH EXAMPLES To create a self-extracting archive \fIletters\fP from a regular zipfile \fIletters.zip\fP and change the new archive's permissions to be world-executable under Unix: .PP .EX cat unzipsfx letters.zip > letters chmod 755 letters zip -A letters .EE .PP To create the same archive under MS-DOS, OS/2 or NT (note the use of the \fB/b\fP [binary] option to the \fIcopy\fP command): .PP .EX copy /b unzipsfx.exe+letters.zip letters.exe zip -A letters.exe .EE .PP Under VMS: .PP .EX copy unzipsfx.exe,letters.zip letters.exe letters == "$currentdisk:[currentdir]letters.exe" zip -A letters.exe .EE .PP (The VMS \fIappend\fP 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: .PP .EX MakeSFX letters letters.zip UnZipSFX .EE .PP (MakeSFX is included with the UnZip source distribution and with Amiga binary distributions. ``\fCzip -A\fR'' doesn't work on Amiga self-extracting archives.) To test (or list) the newly created self-extracting archive: .PP .EX letters \-t .EE .PP To test \fIletters\fP quietly, printing only a summary message indicating whether the archive is OK or not: .PP .EX letters \-tqq .EE .PP To extract the complete contents into the current directory, recreating all files and subdirectories as necessary: .PP .EX letters .EE .PP To extract all \fC*.txt\fR files (in Unix quote the `*'): .PP .EX letters *.txt .EE .PP To extract everything \fIexcept\fP the \fC*.txt\fR files: .PP .EX letters -x *.txt .EE .PP To extract only the README file to standard output (the screen): .PP .EX letters -c README .EE .PP To print only the zipfile comment: .PP .EX letters \-z .EE .PD .\" ========================================================================= .SH LIMITATIONS The principle and fundamental limitation of \fIunzipsfx\fP is that it is not portable across architectures or operating systems, and therefore neither are the resulting archives. For some architectures there is limited portability, however (e.g., between some flavors of Intel-based Unix). .PP Another problem with the current implementation is that any archive with ``junk'' prepended to the beginning technically is no longer a zipfile (unless \fIzip\fP(1) is used to adjust the zipfile offsets appropriately, as noted above). \fIunzip\fP(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. .PP \fIunzipsfx\fP 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, \fIunzipsfx\fP 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. .PP As noted above, a number of the normal \fIunzip\fP(1L) functions have been removed in order to make \fIunzipsfx\fP 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. .PP VMS users must know how to set up self-extracting archives as foreign commands in order to use any of \fIunzipsfx\fP's options. This is not necessary for simple extraction, but the command to do so then becomes, e.g., ``\fCrun letters\fR'' (to continue the examples given above). .PP \fIunzipsfx\fP 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. .PP All current bugs in \fIunzip\fP(1L) exist in \fIunzipsfx\fP as well. .PD .\" ========================================================================= .SH DIAGNOSTICS \fIunzipsfx\fP's exit status (error level) is identical to that of \fIunzip\fP(1L); see the corresponding man page. .PD .\" ========================================================================= .SH "SEE ALSO" \fIfunzip\fP(1L), \fIunzip\fP(1L), \fIzip\fP(1L), \fIzipcloak\fP(1L), \fIzipgrep\fP(1L), \fIzipinfo\fP(1L), \fIzipnote\fP(1L), \fIzipsplit\fP(1L) .PD .PD .\" ========================================================================= .SH URL The Info-ZIP home page is currently at .EX \fChttp://www.info-zip.org/pub/infozip/\fR .EE or .EX \fCftp://ftp.info-zip.org/pub/infozip/\fR . .EE .PD .\" ========================================================================= .SH AUTHORS Greg Roelofs was responsible for the basic modifications to UnZip necessary to create UnZipSFX. See \fIunzip\fP(1L) for the current list of Zip-Bugs authors, or the file CONTRIBS in the UnZip source distribution for the full list of Info-ZIP contributors. .PD