unzipsfx - extraction (SFX) program. Append a ZIP archive to it to make a self-extracting archive bundle.
name_of_unzipsfx+archive_bundle [ unzip_options ] [ member ... ]
UNZIPSFX(1) General Commands Manual UNZIPSFX(1) NAME unzipsfx - self-extraction (SFX) program. Append a ZIP archive to it to make a self-extracting archive bundle. SYNOPSIS name_of_unzipsfx+archive_bundle [ unzip_options ] [ member ... ] DESCRIPTION UnZipSFX is a special edition of UnZip which is designed to be attached to the beginning of an existing, ordinary ZIP archive to form a self- extracting (SFX) archive. Unlike the normal UnZip program, which works on an archive specified on its command line, UnZipSFX works on an ar- chive which has been appended to itself. Minimizing the size of a self-extracting archive, means minimizing the size of the UnZipSFX program itself. Thus UnZipSFX is normally built without some of the less important features found in the normal UnZip program. Among these are the help/usage displays (-h, -hh), the list- ing and diagnostic functions (-l, -v), the ability to process some older compression methods ("Implode", "Reduce", "Shrink"), and, by default, some newer compression methods (bzip2, LZMA, PPMd) and any encryption methods. Starting with UnZipSFX version 5.50, the ability to extract to a direc- tory other than the current one (-d dest_dir) has been enabled by default. Some or all of the optional compression and/or encryption methods can be enabled at build time, at the cost of increasing the size of the resulting UnZipSFX program. Starting with UnZip version 5.50, another build-time option adds a sim- ple "run command after extraction" feature. This feature is currently incompatible with the "extract to different directory" (-d dest_dir) feature, and remains disabled by default. All the build-time options controlling UnZipSFX features should be explained in the UnZip installation instructions (INSTALL). Note that the features (such as optional encryption or compression methods) which are available in an UnZipSFX executable are determined when the UnZipSFX executable is built. However, the features which are needed are determined when the ZIP archive is created. The user must decide which optional features to include in or exclude from the UnZipSFX exe- cutable, and then use only the available UnZipSFX features when creat- ing an archive for use as a self-extracting archive. Enabling optional features in UnZipSFX makes the executable bigger (and hence SFX ar- chives made with it). Of course, the greater efficiency of some optional compression method might save enough space to compensate for the bigger UnZipSFX executable which would be needed to deal with it. And, if encryption is desired, then the UnZipSFX executable must be able to deal with that. Users with complex requirements may find it useful to build multiiple UnZipSFX executables with different feature sets for different pur- poses. The user is responsible for managing multiple UnZipSFX executa- bles. The UnZip builders offer no tools to help, and, without a "-v" report, determining the capabilities of an UnZipSFX executable is not very easy. The user is also responsible for testing a self-extracting archive on the target system, to ensure that the UnZipSFX executable used has all the features it needs to process the attached archive. Note that the UnZipSFX executable in a self-extracting archive is a real executable program, and so is not generally portable from one operating system or hardware architecture to another. The ZIP archive within a self-extracting archive can be pro- cessed anywhere using a normal UnZip program. (At worst, UnZip will emit a warning like "nnnn extra bytes at beginning or within zipfile", but using "zip -A" on an SFX bundle will pre- vent even that annoyance.) ARGUMENTS member ... An optional list of archive members to be processed, separated by spaces. If no member list is specified, then all archive members are processed. Wildcard patterns may be used to match multiple members. These wildcard expressions are similar to those supported (for "globbing") in commonly used Unix shells (csh, ksh, sh, and so on) and may contain: * matches a sequence of 0 or more characters. ? matches exactly 1 character. [...] 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 ("^") follows the left bracket, then the range of characters within the brackets is complemented. That is, anything except the characters inside the brackets is considered a match. To specify a literal left bracket, use the three-character sequence "[". Be sure to escape or quote any character(s) that might otherwise be interpreted or modified by the operating system, particularly Unix shells. OPTIONS (Primary Mode) Options in this group (-c -f -p -t -u -z) specify the primary mode of operation of UnZipSFX. Only one of these primary mode options may be specified. -c --to-stdout Primary Mode. Extract files to stdout/screen. This option is similar to the -p option except that the name of each file is displayed as it is extracted, and the -a option is allowed, which can provide automatic ASCII-EBCDIC conversion, where appropriate. -f --freshen Primary Mode. Freshen existing files. That is, extract only those files that already exist on disk and that are newer than the disk copies. By default, UnZipSFX queries before overwrit- ing, but the -o option may be used to suppress the queries. Note that on many operating systems, the TZ (timezone) environ- ment variable must be set correctly in order for -f and -u to work properly. (On Unix the variable is usually set automati- cally.) The reasons for this are somewhat subtle but have to do with the differences between DOS-format file times (always local time) and Unix-format times (always UTC) and the necessity to compare the two. A typical TZ value is "PST8PDT" (US Pacific time with automatic adjustment for Daylight Saving Time). -p --pipe-to-stdout Primary Mode. Extract files to stdout (pipe). Only the actual file data for the members are sent to stdout (no file names, or other information, as would be displayed with -c), and the files are always extracted in binary format, just as they are stored (no line-ending or ASCII-EBCDIC conversions). -t --test Primary Mode. Test archive members. Testing means that each archive member is extracted in memory (expanding and decrypting, as needed), but not written to a file. The resulting CRC (cyclic redundancy check, an enhanced checksum) of the extracted data is then compared with the original file's stored CRC value, and an error message is emitted if a CRC mismatch is detected. -u --update Primary mode. Update existing files and create new ones if needed. This mode performs the same function as the Freshen (-f) mode, extracting (with query) files that are newer than those with the same name on disk, but it also extracts those files that do not already exist on disk. See -f, above, for information on setting the timezone properly. -z --zipfile-comment Primary mode. Display only the archive comment. OPTIONS (Ordinary) -2 --force-ods2 [VMS] Convert extracted file names to ODS2-compatible names, even on an ODS5 file system. By default, if the destination file system is ODS5, case is preserved, and extended file name characters are caret-escaped as needed, while if the destination file system is ODS2, ODS2-invalid characters are replaced by underscores. -a --ascii Convert text files. Ordinarily, all files are extracted exactly as they are stored, byte-for-byte. With -a, line endings in a text file are adjusted to the local standard as the file is extracted. When appropriate, ASCII<-->EBCDIC conversion is also done. Zip (or a similar archiving program) identifies files as "binary" or "text" when they are archived. (A short-format Zip- Info report denotes a binary file with a "b", and a text file with a "t".) Zip's identification of text files may not be per- fect, so UnZipSFX prints "[text]" or "[binary]" as a visual check for each file it extracts with -a. The -aa option forces all files to be extracted (and converted) as text, regardless of the supposed file type. [VMS] On VMS, for archives with VMS attribute information (made with "zip -V" or "ZIP /VMS"), files are always created with their original record formats. For archives without VMS attribute information (not made with "zip -V" or "ZIP /VMS"), all files are normally created with Stream_LF record format. With -a, text files are normally created with variable-length record format, but adding -S gives them Stream_LF record format. With -aa, all files are treated as text files. See also -b and -S. Support for line-ending conversion for text files may be removed in some future UnZipSFX version, because the creator of a self- ectracting archive should easily be able to ensure that text files have the appropriate characteristics for the SFX target system (and expecting the SFX user to specify the appropriate option is unreliable). ASCII-EBCDIC conversion must continue to be supported, because the ZIP archive format implies ASCII stor- age of text files. -b --binary [Tandem, VMS] Selects the file record format used when extract- ing binary files. -b may conflict or interact with -a in dif- ferent ways on different system types. -b is ignored on systems other than Tandem and VMS. Zip (or a similar archiving program) identifies files as "binary" or "text" when they are archived. (A short-format Zip- Info report denotes a binary file with a "b", and a text file with a "t".) [Tandem] Force the creation files with filecode type 180 ('C') when extracting archive members marked as "text". (On Tandem, -a is enabled by default, see above). [VMS] On VMS, for archives with VMS attribute information (made with "zip -V" or "ZIP /VMS"), files are always created with their original record formats. For archives without VMS attribute information (not made with "zip -V" or "ZIP /VMS"), files are normally created with Stream_LF record format. With -b, binary files are created with fixed-length, 512-byte record format. With -bb, all files are treated as binary files. When extracting to standard output (-c or -p option in effect), the default conversion of text record delimiters is disabled for binary files (with -b), or for all files (with -bb). -C --ignore-case ([CMS, MVS] --CMS-MVS-lower) Use case-insensitive name matching for file names in the file list and the -x excluded-file list on the command line. By default, case-sensitive matching is done. For example, specify- ing "makefile" on the command line will match only "makefile" in the archive, not "Makefile" or "MAKEFILE". On many systems, the local file system is case-insensitive, so case-insensitive name matching would be more natural. With -C, "makefile" would match "makefile", "Makefile", or "MAKEFILE". -C does not affect the matching of archive members to existing files on the extraction path. So, on a case-sensitive file sys- tem, UnZipSFX will never try to overwrite a file "FOO" when extracting a member named "foo"! -c --to-stdout Primary Mode. Extract files to stdout/screen. For details, see Primary Mode options. -D --dir-timestamps Control timestamps on extracted files and directories. By default, UnZipSFX restores timestamps for extracted files, but not for directories it creates. Specifying -D tells UnZipSFX not to restore any timestamps. Specifying -D- tells UnZipSFX to restore timestamps for directories as well as other items. -D- works only on systems that support setting timestamps for direc- tories (currently ATheOS, BeOS, MacOS, OS/2, Unix, VMS, Win32). On other systems, -D- has no effect. [Non-VMS] Timestamp restoration behavior changed between UnZip versions 6.00 and 6.1. The following table shows the effects of various -D options for both versions. UnZip version | 6.00 | 6.1 | Restore timestamps on: -----------+-----------+------------------------ -DD | -D | Nothing. -D | (default) | Files, not directories. (default) | -D- | Files and directories. [VMS] The old behavior on VMS was the same as the new behavior on all systems. (The old negated --D option is now -D-, because of changes to the command-line parser.) -d dest_dir --extract-dir dest_dir Specifies a destination directory for extracted files. By default, files are extracted (and subdirectories created) in the current directory. With -d dest_dir, extraction is done into the specified directory, instead. The option and directory may be concatenated without any white space between them, but this may cause normal shell behavior to be suppressed. For example, "-d ~" (tilde) is expanded by Unix shells into the name of the user's home directory, but "-d~" is treated as a literal "~" subdirectory of the current directory. [VMS] On VMS, only a VMS-style device:[directory] specification is permitted. This option may be disabled at build time in UnZipSFX. -F --keep-nfs [Acorn] Suppress removal of NFS filetype extension from stored filenames. [non-Acorn systems supporting long filenames with embedded com- mas, and only if compiled with ACORN_FTYPE_NFS defined] Trans- late filetype information from ACORN RISC OS extra field blocks into a NFS filetype extension and append it to the names of the extracted files. (When the stored filename appears already to have an appended NFS filetype extension, it is replaced by the info from the extra field.) -f --freshen Primary Mode. Freshen existing files. For details, see Primary Mode options. -I char_set --iso-char-set char_set [Unix] Select ISO character set char_set. -J --junk-attrs [BeOS] Junk file attributes. The file's BeOS file attributes are not restored, only the file's data. [MacOS] Ignore MacOS extra fields. All Macintosh-specific info is skipped. AppleDouble files are restored as separate files. -j[=depth] --junk-dirs[=depth] Junk directories. With -j, all directory information is stripped from an archive member name, so all files are extracted into the destination directory. (See also -d.) If a depth (=depth, where depth is a positive integer) is speci- fied, then that number of directory levels will be stripped from an archive member name. For example, an archive member like "a/b/c/d/ee.txt" would normally be extracted as "a/b/c/d/ee.txt". With -j, it would be extracted as "ee.txt". With -j=2, the first two directory levels would be stripped, so it would be extracted as "c/d/ee.txt". --jar Treat archive(s) as Java JAR. Over-simplification in Java JAR archives can cause UnZipSFX to transform UTF-8 file names according to inappro- priate (MS-DOS) rules, yielding corrupt names on extracted files (typi- cally those with character codes 128-255). Archives containing a Java "CAFE" extra field should be detected automatically, and handled cor- rectly, but not all JAR archives include that extra field. Specifying --jar tells UnZipSFX to expect UTF-8 file names, regardless of whether the archive contains a "CAFE" extra field. -k --keep-permissions [AtheOS, BeOS, Unix, VMS] Control how archived permissions or protections are restored on extracted files and directories. By default, archived permissions are restored with some limita- tions. On AtheOS, BeOS, and Unix, the current umask value is applied (to the normal user/group/other permissions). On VMS, the current default protection is applied to the UIC-based (SOGW) protections. With -k, the archived permissions are restored without regard to the Unix umask or VMS default protection. (This was the default behavior in UnZip versions before 6.1.) With -k-, the archived permissions are ignored, so only the Unix umask or VMS default protection is effective. (On VMS, directo- ries are always created without any Delete access.) On AtheOS, BeOS, and Unix, the SUID/SGID/Tacky permission bits are controlled by the -K/--keep-s-attrs option, regardless of the -k/--keep-permissions setting. -ka --keep-acl [VMS] Restore ACLs on extracted files and directories. -L --lowercase-names Convert to lowercase any filename originating on an uppercase- only operating system or file system. (This was UnZipSFX's default behavior in versions before 5.11. The current default behavior is the same as the old behavior with the -U option. -U is now used for another purpose.) Depending on the archiver, files archived from single-case file systems (old MS-DOS FAT, VMS ODS2, and so on) may be stored as all-uppercase names; this can be ugly or inconvenient when extracting to a case-preserving file system such as OS/2 HPFS or a case-sensitive one such as on Unix. By default, UnZipSFX lists and extracts such filenames exactly as they're stored (excepting truncation, conversion of unsupported characters, an so on). With -L, the names of all files from certain systems will be converted to lowercase. With -LL, all file names will be down-cased, regardless of the originating file system. -M [CMS,MVS] Or: -m) --more Pipe all output through an internal pager similar to the Unix more(1) command. At the end of a screenful of output, UnZipSFX pauses with a "--More--" prompt; the next screenful may be viewed by pressing the Enter/Return key or the space bar. UnZipSFX can be terminated by pressing the "Q" key and, on some systems, the Enter/Return key. Unlike Unix more(1), there is no forward-searching or editing capability. Also, UnZipSFX doesn't notice if long lines wrap at the edge of the screen, effectively resulting in the printing of two or more lines and the likeli- hood that some text will scroll off the top of the screen before being viewed. If the actual number of lines on the screen can not be determined, 24 lines will be assumed. -n --never-overwrite When extracting, never overwrite existing files. If a file already exists, then skip the extraction of that file without asking. See also -o (--overwrite). By default, UnZipSFX queries the user before extracting any file that already exists. The user may choose to overwrite only the current file, overwrite all files, skip extraction of the cur- rent file, skip extraction of all existing files, or rename the current file (choose a new name for the extracted file). [VMS] On VMS, the usual query choices are to create a new ver- sion of an existing file, to skip extraction, or to rename the current file. In the case where an archive member name includes a version number, and -V ("retain VMS file version numbers") is in effect, then an additional query choice is offered: to over- write the existing file. -O char_set --oem-char-set char_set [Unix] Select OEM character set char_set. -o --overwrite When extracting, always overwrite existing files without prompt- ing. This is a dangerous option, so use it with care. (It is often used with -f, however, and is the only way to overwrite directory EAs on OS/2.) See also -n (--never-overwrite). By default, UnZipSFX queries the user before extracting any file that already exists. [Non-VMS] On non-VMS systems, the user may choose to overwrite only the current file, overwrite all files, skip extraction of the current file, skip extraction of all existing files, or rename the current file (choose a new name for the extracted file). [VMS] On VMS, the usual query choices are to create a new ver- sion of an existing file, to skip extraction, or to rename the current file. In the case where an archive member name includes a version number, and -V ("retain VMS file version numbers") is in effect, then an additional query choice is offered: to over- write the existing file. In this case, -o selects the "new ver- sion" choice, and -oo (or: -o -o) selects the "overwrite" choice. -P password --password password [CRYPT_AES_WG, CRYPT_TRAD] -P ("--password") is valid only if encryption support was enabled at build-time for the UnZipSFX program. Use password to decrypt encrypted archive members (if any). THIS IS INSECURE! Many multi-user operating systems provide ways for any user to see the current command line of any other user. Even on stand-alone systems, there is always the threat of over-the-shoulder peeking. Storing the plaintext password as part of a command line in an automated script can be even less secure, Whenever possible, use the non-echoing, interactive prompt to enter passwords. Where security is truly important, use a strong encryption method, such as AES, instead of the rel- atively weak encryption provided by Traditional ZIP encryption. Or, use an external encryption program, such as GnuPG, before archiving the file. (Note that Zip will probably not be able to do significant compression on a file which has already been encrypted.) -p --pipe-to-stdout Primary Mode. Extract files to stdout (pipe). For details, see Primary Mode options. -q --quiet Perform operations quietly. (-qq: even more quietly). By default, UnZipSFX prints the names of the files it's extracting or testing, the extraction methods, any member or archive com- ments that may be stored in the archive, and possibly a summary when finished with each archive. The -q[q] options suppress the printing of some or all of these messages. -r --remove-exts [Tandem] Remove file extensions. -S --stream_lf [VMS] Use Stream_LF record format when converting extracted text files (-a, -aa), instead of the text-file default, variable- length record format. [VMS] On VMS, for archives with VMS attribute information (made with "zip -V"), files are always created with their original record formats. For archives without VMS attribute information (not made with "zip -V"), all files are normally created with Stream_LF record format. With -a, text files are normally cre- ated with variable-length record format, but adding -S gives them Stream_LF record format. With -aa, all files are treated as text files. See also -a and -b. -s --space_to_uscore Convert spaces in filenames to underscores. Normally, on a sys- tem which allows spaces in filenames, UnZipSFX extracts file- names with spaces intact (for example, "EA DATA. SF"). Working with such file names can be awkward, however, so -s can be used to replace spaces with underscores. -t --test Primary Mode. Test archive members. For details, see Primary Mode options. -U --unicode [UNICODE_SUPPORT] Control UTF-8 handling. When UNICODE_SUPPORT is available, -U forces UnZipSFX to escape all non-ASCII charac- ters from UTF-8 coded filenames as "#Uxxxx' (for UCS-2 charac- ters, or "#Lxxxxxx" for Unicode codepoints needing 3 octets). This option is provided mainly for debugging, when the fairly new UTF-8 support is suspected of mangling extracted filenames. -UU disables the recognition of UTF-8 encoded filenames. The handling of filename codings within UnZipSFX falls back to the behavior of pre-Unicode versions. [old, obsolete usage] Leave filenames uppercase if created on MS-DOS, VMS, and so on. See -L. -u --update Primary mode. Update existing files and create new ones if needed. For details, see Primary Mode options. -V --keep-versions [Non-CMS-MVS] Retain VMS file version numbers. VMS files can be stored with a version number, in the format file.type;##, where "##" is a positive decimal number. By default, the ";##" version numbers are stripped, but this option allows them to be retained. (On file systems that limit filenames to particularly short lengths, the version numbers may be truncated or stripped regardless of this option.) [Non-VMS] Note that before UnZip version 6.1, on a non-VMS sys- tem, a file with a name like "fred;123" would, by default, be extracted as "fred", even if the file did not originate on a VMS system (so that ";123" was probably not really a VMS version number). Beginning with UnZip version 6.1, the default behavior is to strip VMS version numbers only from files which were archived on a VMS system. To restore the old behavior, and always strip apparent VMS version numbers, explicitly negate the option: -V-. [VMS] Note that on VMS, -V affects only version numbers, and is not needed to restore VMS file attributes. Zip's -V (/VMS) option is required to store VMS attributes in an archive. If that was done when an archive was created, then UnZipSFX will always restore those attributes when a file is extracted. -W --wild-no-span [WILD_STOP_AT_DIR] (Valid when the program was built with the C macro WILD_STOP_AT_DIR defined.) By default, the wildcard char- acters "?" (single-character wildcard) and "*" (multi-character wildcard) match any character in a member path/name. "-W" modi- fies the pattern-matching behavior for archive members so that both "?" (single-character wildcard) and "*" (multi-character wildcard) do not match the directory separator character "/". (The two-character sequence "**" acts as a multi-character wild- card that includes the directory separator in its matched char- acters.) For example, with "-W": "*.c" matches "foo.c" but not "mydir/foo.c" "**.c" matches both "foo.c" and "mydir/foo.c" "*/*.c" matches "bar/foo.c" but not "baz/bar/foo.c" "??*/*" matches "ab/foo" and "abc/foo" but not "a/foo" or "a/b/foo" This modified behavior is equivalent to the pattern matching style used by the shells of some of UnZipSFX's supported target OSs (one example is Acorn RISC OS). This option may not be available on systems where the Zip archive's internal directory separator character "/" is allowed as regular character in native operating system filenames. [non-VMS] Currently, UnZipSFX uses the same pattern matching rules for both wildcard archive file name specifications and ar- chive member selection patterns on most system types. For sys- tems allowing "/" as regular filename character, the -W option would not work as expected on a wildcard file name specifica- tion. -X --restore-info [VMS, Unix, OS/2, NT, Tandem] Restore owner info (UIC on VMS, or user and group info (UID/GID) on Unix, or access control lists (ACLs) on certain network-enabled versions of OS/2 (Warp Server with IBM LAN Server/Requester 3.0 to 5.0; Warp Connect with IBM Peer 1.0), or security ACLs on Windows NT.) In most cases this will require special system privileges, and doubling the option (-XX) on NT instructs UnZipSFX to use privileges for extraction; but on Unix, for example, a user who belongs to several groups can restore files owned by any of those groups, so long as the user IDs match the user's own. Note that ordinary file attributes are always restored. This option applies only to optional, extra ownership info available on some operating sys- tems. (NT's access control lists do not appear to be especially compatible with OS/2's, so no attempt is made at cross-platform portability of access privileges. It is not clear under which conditions this would ever be useful anyway.) -x member ... --exclude member ... An optional list of archive members to be excluded from process- ing. Because wildcard characters normally match "/" directory separators (for exceptions, see the option -W), this option may be used to exclude any files that are in subdirectories. For example, "unzip foo *.[ch] -x */*" would extract all C source files (*.c, *.h) in the main directory, but none in any subdi- rectories. Without the -x option, all C source files in all directories in the archive would be extracted. When the program sees -x (--exclude) on a command line, it stops scanning for options, and treats every succeeding item as an ar- chive member name. To avoid any confusion between member names and command options, it's simplest to specify -x (--exclude mem- ber) and its member list as the last items on a command line. Alternatively, the special name "@" can be used to terminate the member list (and cause the program to resume scanning for options). That is, for example, the following two commands are equivalent: example_sfx -b -x file1 file2 file3 example_sfx -x file1 file2 file3 @ -b -Y --dot-version [VMS] Treat archive member name endings of ".nnn" (where "nnn" is a decimal number) as if they were VMS version numbers (";nnn"). (The default is to treat them as file types.) For example: "a.b.3" -> "a.b;3" -z --zipfile-comment Primary mode. Display only the archive comment. For details, see Primary Mode options. -$ --volume-labels [MS-DOS, NT, OS/2, VMS] Restore the volume label if the extrac- tion medium is removable (for example, a diskette). Doubling the option (-$$) allows fixed media (hard disks) to be labeled as well. By default, volume labels are ignored. [VMS] On VMS, a volume must be allocated, not shared, for a vol- ume label to be set. -/ --extensions [Acorn] Overrides the extension list supplied by the Unzip$Ext environment variable. During extraction, filename extensions that match one of the items in this extension list are swapped in front of the base name of the extracted file. -: --do-double-dots [all but Acorn, VM/CMS, MVS, Tandem] Allows UnZipSFX to extract archive members into locations outside of the current extraction destination directory (and its subdirectories). For security reasons, UnZipSFX normally removes "parent direc- tory" path components ("../") from the path names of archive members as they are extracted. This safety feature (new for version 5.50) prevents UnZipSFX from accidentally writing files to directories outside the current destination directory tree. The -: option sets UnZipSFX back to its previous, more liberal behavior, allowing exact extraction of archives that use "../" path components to create multiple directory trees at or above the level of the destination directory. This option does not enable writing explicitly to the root directory ("/"). To achieve this, it is necessary to set the extraction target folder to "/" (by using an option like "-d /"). However, when the -: option is specified, it is still possible implicitly to write to the root directory if member paths specifying enough "../" path components. Use this option with extreme caution. -^ --control-in-name [Unix] Allow control characters in file names of extracted ZIP archive members. On Unix, a file name may contain any (8-bit) character code with the two exceptions of "/" (the directory delimiter) and NUL (0x00, the C string-termination character), unless the specific file system has more restrictive conven- tions. Generally, this allows embedding ASCII control charac- ters or escape sequences in file names. However, this feature allows the use of malicious file names which can cause various kinds of bad trouble when displayed on a user's terminal/emula- tor. (Even a file name with unprintable but otherwise harmless characters can cause problems for users.) For these reasons, by default, UnZipSFX applies a filter that removes potentially dangerous control characters from the extracted file names. The -^ option overrides this filter in the rare case that embedded filename dangerous control charac- ters are to be intentionally restored. ENVIRONMENT OPTIONS UnZipSFX uses the same environment variables as UnZip does, although this is more likely to affect the person creating and testing a self- extracting archive than it is the SFX user. For details, see the unzip manual page. ENCRYPTION/DECRYPTION UnZipSFX supports the same encryption methods as UnZip, but encryption support in UnZipSFX must be explicitly enabled at build time. For details, see the UnZip installation instructions (INSTALL). AUTORUN COMMAND When UnZipSFX is built with CHEAP_SFX_AUTORUN defined, a simple "com- mand autorun" feature is enabled. The command to be run is placed at the beginning of the Zip archive comment, using the following format: $AUTORUN$>command-to-be-run When UnZipSFX recognizes the token "$AUTORUN$>" 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. For safety, when the user has switched off prompting by specifying the -q option, an autorun command is not exe- cuted. If the archive comment contains additional lines of text, then those additional comment lines are displayed normally, unless quiet operation was requested using a -q option. EXAMPLES On Unix, the following commands create a self-extracting archive (exam- ple_sfx) from an ordinary archive (example.zip), adjust the offsets in the resulting SFX archive, and change the permissions on the new SFX archive's to allow execution by everyone: cat /usr/local/bin/unzipsfx example.zip > example_sfx zip -A example_sfx chmod 755 example_sfx We assume that the desired UnZipSFX executable is found at "/usr/local/bin/unzipsfx", but any path to the desired UnZipSFX exe- cutable is ok. On MS-DOS, OS/2, or Windows, the following commands create a similar SFX archive. (Note the use of the /b (binary) option in the COPY com- mand.): copy /b unzipsfx.exe+example.zip example_sfx.exe zip -A example_sfx.exe If the desired UnZipSFX executable is not in the current directory, then an appropriate path should be specified for it. On VMS the basic commands look like these: copy unzipsfx.exe, example.zip example_sfx.exe zip -A example_sfx.exe If the desired UnZipSFX executable is not in the current default direc- tory, then an appropriate path should be specified for it. (The VMS APPEND command could be used instead of COPY.) A slightly more elaborate DCL script to do this job is included in the UnZip source kit: [.vms]makesfx.com. It uses a DCL symbol to find the UnZipSFX executable. Comments in the script explain its usage. @ makesfx.com example.zip example_sfx.exe As usual on VMS, if a program like an UnZipSFX bundle is to be executed without options or arguments, then the RUN command may be used. For example: run example_sfx.exe More work is needed when options or arguments are desired. For exam- ple: mcr sys$disk:example_sfx.exe -t -x fred.txt Or, define a foreign-command DCL symbol, and use that: example_sfx = "$ ''f$environment( "default")'example_sfx.exe" example_sfx -t -x fred.txt On AmigaDOS: MakeSFX example example.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, use -t: example_sfx -t To test "example_sfx" quietly, printing only a summary message indicat- ing whether the archive is OK or not, use -tqq: example_sfx -tqq To extract the complete contents into the current directory, recreating all files and subdirectories as necessary: example_sfx To extract all *.txt files: example_sfx *.txt On Unix, quote the "*": example_sfx '*.txt' To extract everything except the *.txt files: example_sfx -x *.txt or: example_sfx -x '*.txt' To extract only the README file to standard output (the screen): example_sfx -c README To print only the archive comment: example_sfx -z LIMITATIONS The principal and fundamental limitation of UnZipSFX is that it is not generally portable from one operating system or hardware architecture to another. Therefore, neither are the resulting SFX archives, as self-extracting archives. The ZIP archive within a self-extracting ar- chive bundle can always be processed anywhere using a normal UnZip pro- gram, even where the UnZipSFX program in the bundle can't do the job. At worst, UnZip will emit a warning like "nnnn extra bytes at beginning or within zipfile", but using "zip -A" on an SFX bundle will prevent even that annoyance. (UnZipSFX itself does not emit the "extra bytes" warning, even if the "zip -A" adjustment is not done.) Strictly speaking, until "zip -A" is used to adjust the offsets within the UnZipSFX+archive bundle, that bundle is not a valid ZIP archive, because the offsets in it are wrong. Info-ZIP UnZip can still work with it (emitting that "extra bytes" warning mentioned above), but some other unzipping program might have more trouble with it. After the "zip -A" offset adjustment has been done, any unzipping program should be able to work with the resulting SFX bundle. To do its work, the UnZipSFx program in a self-extracting archive must open and read the self-extracting archive file itself. (It's not enough that the shell can find it. It must be able to find itself.) UnZipSFX has no knowledge of the user's PATH, so, in general, a self- extracting archive must either be in the current directory when it is invoked (and "." must be on the user's PATH), or else some explicit (absolute or relative) path must be specified. For example: # example_sfx -t # Fails if "." is not on PATH. bash: example_sfx: command not found # ./example_sfx -t # Works. or: mkdir sandbox cd sandbox ../example_sfx If a user runs a self-extracting archive which is found in a directory on the PATH other than the current one ("."), then UnZipSFX may fail with a fatal error: "cannot find myself!". This is always true on Unix, and may be true in some cases under MS-DOS, depending on the com- piler used. (Microsoft C may fully qualify the program name, but other compilers may not.) Under OS/2 and NT there are operating-system func- tions available that provide the full path name, so the archive may be invoked from anywhere in the user's path. On VMS, this problem never arises, because the program always sees an absolute path to itself, even when DCL$PATH is used. (The situation is unknown for more obscure operating systems: AmigaDOS, Atari TOS, and so on. Reports are wel- come.) As explained above, some normal UnZip features are omitted from UnZipSFX to make it smaller. The diagnostic (-v) and listing (-l) fea- tures are always omitted. Optional compression methods (bzip2, LZMA, PPMd) and any encryption methods (Traditional, AES_WG) are omitted by default, but may be enabled when UnZipSFX is built. For details, see the installation instructions (INSTALL). UnZipSFX on the Amiga requires the use of a special program, MakeSFX, 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. EXIT STATUS The possible exit status values from UnZipSFX are the same as those for UnZipSFX. See the unzip manual page for details. ATTRIBUTES See attributes(7) for descriptions of the following attributes: +---------------+------------------+ |ATTRIBUTE TYPE | ATTRIBUTE VALUE | +---------------+------------------+ |Availability | compress/unzip | +---------------+------------------+ |Stability | Volatile | +---------------+------------------+ SEE ALSO funzip(1L), unzip(1L), zip(1L), zipcloak(1L), zipgrep(1L), zipinfo(1L), zipnote(1L), zipsplit(1L) URL The Info-ZIP main Web page is: http://www.info-zip.org/ FTP access is available, too: ftp://ftp.info-zip.org/pub/infozip/ AUTHORS Greg Roelofs was responsible for the basic modifications to UnZip nec- essary to create UnZipSFX. See unzip(1L) for the current list of Info- ZIP authors. NOTES This software was built from source available at https://github.com/oracle/solaris-userland. The original community source was downloaded from http://antinode.info/ftp/info- zip/unzip610c23.zip Further information about this software can be found on the open source community website at http://www.info-zip.org/UnZip.html. Info-ZIP 15 Apr 2015 (v6.1) UNZIPSFX(1)