1UNZIPSFX(1L)                                                      UNZIPSFX(1L)
2
3
4

NAME

6       unzipsfx - self-extracting stub for prepending to ZIP archives
7

SYNOPSIS

9       <name  of  unzipsfx+archive  combo>  [-cfptuz[ajnoqsCLV$]] [file(s) ...
10       [-x xfile(s) ...]]
11

DESCRIPTION

13       unzipsfx is a modified version of unzip(1L) designed to be prepended to
14       existing  ZIP  archives  in  order  to  form  self-extracting archives.
15       Instead of taking its first non-flag argument to be the  zipfile(s)  to
16       be  extracted,  unzipsfx  seeks  itself  under the name by which it was
17       invoked and tests or extracts the contents  of  the  appended  archive.
18       Because the executable stub adds bulk to the archive (the whole purpose
19       of which is to be as small as possible), a  number  of  the  less-vital
20       capabilities  in  regular unzip have been removed.  Among these are the
21       usage (or help) screen, the listing and diagnostic  functions  (-l  and
22       -v),   the   ability  to  decompress  older  compression  formats  (the
23       ``reduce,''  ``shrink''  and  ``implode''  methods).   The  ability  to
24       extract  to a directory other than the current one can be selected as a
25       compile-time option, which is now enabled  by  default  since  UnZipSFX
26       version  5.5.   Similary,  decryption  is  supported  as a compile-time
27       option but should be  avoided  unless  the  attached  archive  contains
28       encrypted files. Starting with release 5.5, another compile-time option
29       adds a simple ``run command after extraction'' feature.   This  feature
30       is  currently  incompatible with the ``extract to different directory''
31       feature and remains disabled by default.
32
33       Note that self-extracting archives made with unzipsfx are no  more  (or
34       less)  portable  across  different  operating systems than is the unzip
35       executable itself.  In general a self-extracting archive made on a par‐
36       ticular Unix system, for example, will only self-extract under the same
37       flavor of Unix.  Regular unzip may still be used to extract the  embed‐
38       ded  archive  as  with  any normal zipfile, although it will generate a
39       harmless warning about extra bytes at the  beginning  of  the  zipfile.
40       Despite this, however, the self-extracting archive is technically not a
41       valid ZIP archive, and PKUNZIP may be unable to  test  or  extract  it.
42       This limitation is due to the simplistic manner in which the archive is
43       created; the internal directory structure is not updated to reflect the
44       extra bytes prepended to the original zipfile.
45

ARGUMENTS

47       [file(s)]
48              An  optional  list  of archive members to be processed.  Regular
49              expressions (wildcards) similar to those in Unix egrep(1) may be
50              used to match multiple members.  These wildcards may contain:
51
52              *      matches a sequence of 0 or more characters
53
54              ?      matches exactly 1 character
55
56              [...]  matches  any  single character found inside the brackets;
57                     ranges are specified by a beginning character, a  hyphen,
58                     and  an  ending  character.  If an exclamation point or a
59                     caret (`!' or `^') follows the  left  bracket,  then  the
60                     range  of  characters within the brackets is complemented
61                     (that is,  anything  except  the  characters  inside  the
62                     brackets is considered a match).
63
64              (Be  sure  to quote any character that might otherwise be inter‐
65              preted or modified by the operating system,  particularly  under
66              Unix and VMS.)
67
68       [-x xfile(s)]
69              An optional list of archive members to be excluded from process‐
70              ing.   Since  wildcard  characters  match  directory  separators
71              (`/'),  this option may be used to exclude any files that are in
72              subdirectories.  For example, ``foosfx  *.[ch]  -x  */*''  would
73              extract  all  C  source files in the main directory, but none in
74              any subdirectories.  Without the -x option, all C  source  files
75              in all directories within the zipfile would be extracted.
76
77       If unzipsfx is compiled with SFX_EXDIR defined, the following option is
78       also enabled:
79
80       [-d exdir]
81              An optional directory to which to extract  files.   By  default,
82              all files and subdirectories are recreated in the current direc‐
83              tory; the -d option allows extraction in an arbitrary  directory
84              (always  assuming one has permission to write to the directory).
85              The option and directory may be concatenated without  any  white
86              space  between  them,  but note that this may cause normal shell
87              behavior to be suppressed.  In particular, ``-d ~''  (tilde)  is
88              expanded  by  Unix  C  shells  into  the name of the user's home
89              directory, but ``-d~'' is  treated  as  a  literal  subdirectory
90              ``~'' of the current directory.
91

OPTIONS

93       unzipsfx  supports the following unzip(1L) options:  -c and -p (extract
94       to standard output/screen), -f and  -u  (freshen  and  update  existing
95       files  upon  extraction),  -t (test archive) and -z (print archive com‐
96       ment).  All normal listing options (-l, -v and -Z) have  been  removed,
97       but  the  testing  option (-t) may be used as a ``poor man's'' listing.
98       Alternatively, those creating  self-extracting  archives  may  wish  to
99       include a short listing in the zipfile comment.
100
101       See unzip(1L) for a more complete description of these options.
102

MODIFIERS

104       unzipsfx  currently supports all unzip(1L) modifiers:  -a (convert text
105       files), -n (never overwrite),  -o  (overwrite  without  prompting),  -q
106       (operate  quietly),  -C  (match  names case-insensitively), -L (convert
107       uppercase-OS names to lowercase), -j (junk paths) and -V  (retain  ver‐
108       sion  numbers);  plus  the following operating-system specific options:
109       -X (restore VMS owner/protection info), -s (convert spaces in filenames
110       to  underscores  [DOS,  OS/2,  NT])  and -$ (restore volume label [DOS,
111       OS/2, NT, Amiga]).
112
113       (Support for regular ASCII text-conversion may  be  removed  in  future
114       versions, since it is simple enough for the archive's creator to ensure
115       that text files have the appropriate format for the local  OS.   EBCDIC
116       conversion  will  of  course continue to be supported since the zipfile
117       format implies ASCII storage of text files.)
118
119       See unzip(1L) for a more complete description of these modifiers.
120

ENVIRONMENT OPTIONS

122       unzipsfx  uses  the  same  environment  variables  as  unzip(1L)  does,
123       although this is likely to be an issue only for the person creating and
124       testing the self-extracting archive.  See unzip(1L) for details.
125

DECRYPTION

127       Decryption is supported exactly as in unzip(1L); that is, interactively
128       with  a  non-echoing  prompt  for  the  password(s).  See unzip(1L) for
129       details.  Once again, note that if the archive has no  encrypted  files
130       there  is  no  reason to use a version of unzipsfx with decryption sup‐
131       port; that only adds to the size of the archive.
132

AUTORUN COMMAND

134       When unzipsfx was compiled with  CHEAP_SFX_AUTORUN  defined,  a  simple
135       ``command  autorun'' feature is supported. You may enter a command into
136       the Zip archive comment, using the following format:
137
138       $AUTORUN$>[command line string]
139
140       When unzipsfxP recognizes the ``$AUTORUN$>'' token at the beginning  of
141       the Zip archive comment, the remainder of the first line of the comment
142       (until the first newline character) is passed as a shell command to the
143       operating  system using the C rtl ``system'' function. Before executing
144       the command, unzipsfxP displays the command on the console and  prompts
145       the user for confirmation.  When the user has switched off prompting by
146       specifying the -q option, autorun commands are never executed.
147
148       In case the archive comment  contains  additonal  lines  of  text,  the
149       remainder  of the archive comment following the first line is displayed
150       normally, unless quiet  operation  was  requested  by  supplying  a  -q
151       option.
152

EXAMPLES

154       To create a self-extracting archive letters from a regular zipfile let‐
155       ters.zip and change the new  archive's  permissions  to  be  world-exe‐
156       cutable under Unix:
157
158       cat unzipsfx letters.zip > letters
159       chmod 755 letters
160       zip -A letters
161
162       To  create  the  same archive under MS-DOS, OS/2 or NT (note the use of
163       the /b [binary] option to the copy command):
164
165       copy /b unzipsfx.exe+letters.zip letters.exe
166       zip -A letters.exe
167
168       Under VMS:
169
170       copy unzipsfx.exe,letters.zip letters.exe
171       letters == "$currentdisk:[currentdir]letters.exe"
172       zip -A letters.exe
173
174       (The VMS append command may also be used.  The second command  installs
175       the  new  program as a ``foreign command'' capable of taking arguments.
176       The third line assumes that Zip is already installed as a foreign  com‐
177       mand.)  Under AmigaDOS:
178
179       MakeSFX letters letters.zip UnZipSFX
180
181       (MakeSFX  is included with the UnZip source distribution and with Amiga
182       binary distributions.  ``zip -A'' doesn't work on Amiga self-extracting
183       archives.)   To  test  (or  list) the newly created self-extracting ar‐
184       chive:
185
186       letters -t
187
188       To test letters quietly, printing only  a  summary  message  indicating
189       whether the archive is OK or not:
190
191       letters -tqq
192
193       To extract the complete contents into the current directory, recreating
194       all files and subdirectories as necessary:
195
196       letters
197
198       To extract all *.txt files (in Unix quote the `*'):
199
200       letters *.txt
201
202       To extract everything except the *.txt files:
203
204       letters -x *.txt
205
206       To extract only the README file to standard output (the screen):
207
208       letters -c README
209
210       To print only the zipfile comment:
211
212       letters -z
213

LIMITATIONS

215       The principle and fundamental limitation of unzipsfx is that it is  not
216       portable  across architectures or operating systems, and therefore nei‐
217       ther are the resulting archives.  For some architectures there is  lim‐
218       ited  portability,  however  (e.g., between some flavors of Intel-based
219       Unix).
220
221       Another problem with the current implementation  is  that  any  archive
222       with  ``junk''  prepended  to  the beginning technically is no longer a
223       zipfile (unless zip(1) is used to adjust the zipfile offsets  appropri‐
224       ately, as noted above).  unzip(1) takes note of the prepended bytes and
225       ignores them since some file-transfer protocols, notably MacBinary, are
226       also  known  to  prepend  junk.  But PKWARE's archiver suite may not be
227       able to deal with the modified archive unless  its  offsets  have  been
228       adjusted.
229
230       unzipsfx  has no knowledge of the user's PATH, so in general an archive
231       must either be in the current directory when it is invoked, or  else  a
232       full or relative path must be given.  If a user attempts to extract the
233       archive from a directory in  the  PATH  other  than  the  current  one,
234       unzipsfx  will  print  a  warning to the effect, ``can't find myself.''
235       This is always true under Unix and may be true in some cases under  MS-
236       DOS,  depending  on  the compiler used (Microsoft C fully qualifies the
237       program name, but other compilers may not).  Under OS/2  and  NT  there
238       are  operating-system  calls available that provide the full path name,
239       so the archive may be invoked from anywhere in the  user's  path.   The
240       situation is not known for AmigaDOS, Atari TOS, MacOS, etc.
241
242       As  noted  above,  a number of the normal unzip(1L) functions have been
243       removed in order to make unzipsfx smaller:  usage and diagnostic  info,
244       listing  functions  and  extraction  to  other directories.  Also, only
245       stored and deflated files are  supported.   The  latter  limitation  is
246       mainly relevant to those who create SFX archives, however.
247
248       VMS  users  must know how to set up self-extracting archives as foreign
249       commands in order to use any of unzipsfx's options.  This is not neces‐
250       sary  for  simple  extraction,  but  the command to do so then becomes,
251       e.g., ``run letters'' (to continue the examples given above).
252
253       unzipsfx on the Amiga requires the use of a special  program,  MakeSFX,
254       in  order to create working self-extracting archives; simple concatena‐
255       tion does not work.  (For technically oriented users, the attached  ar‐
256       chive  is  defined  as  a  ``debug hunk.'')  There may be compatibility
257       problems between the ROM levels of older Amigas and newer ones.
258
259       All current bugs in unzip(1L) exist in unzipsfx as well.
260

DIAGNOSTICS

262       unzipsfx's exit status (error level) is identical to that of unzip(1L);
263       see the corresponding man page.
264

SEE ALSO

266       funzip(1L), unzip(1L), zip(1L), zipcloak(1L), zipgrep(1L), zipinfo(1L),
267       zipnote(1L), zipsplit(1L)
268

URL

270       The Info-ZIP home page is currently at
271       http://www.info-zip.org/pub/infozip/
272       or
273       ftp://ftp.info-zip.org/pub/infozip/ .
274

AUTHORS

276       Greg Roelofs was responsible for the basic modifications to UnZip  nec‐
277       essary  to create UnZipSFX.  See unzip(1L) for the current list of Zip-
278       Bugs authors, or the file CONTRIBS in the UnZip source distribution for
279       the full list of Info-ZIP contributors.
280
281
282
283Info-ZIP                   28 February 2005 (v5.52)               UNZIPSFX(1L)
Impressum