Penguin
Annotated edit history of unzipsfx(1) version 2, including all changes. View license author blame.
Rev Author # Line
1 perry 1 UNZIPSFX
2 !!!UNZIPSFX
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 ARGUMENTS
7 OPTIONS
8 MODIFIERS
9 ENVIRONMENT OPTIONS
10 DECRYPTION
11 AUTORUN COMMAND
12 EXAMPLES
13 LIMITATIONS
14 DIAGNOSTICS
15 SEE ALSO
16 URL
17 AUTHORS
18 ----
19 !!NAME
20
21
22 unzipsfx - self-extracting stub for prepending to ZIP archives
23 !!SYNOPSIS
24
25
26 ____
27 [[__-cfptuz__[[__ajnoqsCLV$__]] [[''file(s)'' ...
28 [[__-x__ ''xfile(s)'' ...]]
29 !!DESCRIPTION
30
31
32 ''unzipsfx'' is a modified version of ''unzip''(1L)
33 designed to be prepended to existing ZIP archives in order
34 to form self-extracting archives. Instead of taking its
35 first non-flag argument to be the zipfile(s) to be
36 extracted, ''unzipsfx'' seeks itself under the name by
37 which it was invoked and tests or extracts the contents of
38 the appended archive. Because the executable stub adds bulk
39 to the archive (the whole purpose of which is to be as small
40 as possible), a number of the less-vital capabilities in
41 regular ''unzip'' have been removed. Among these are the
42 usage (or help) screen, the listing and diagnostic functions
43 (__-l__ and __-v__), the ability to decompress older
44 compression formats (the ``reduce,'' ``shrink'' and
45 ``implode'' methods). The ability to extract to a directory
46 other than the current one can be selected as a compile-time
47 option, which is now enabled by default since UnZipSFX
48 version 5.5. Similary, decryption is supported as a
49 compile-time option but should be avoided unless the
50 attached archive contains encrypted files. Starting with
51 release 5.5, another compile-time option adds a simple ``run
52 command after extraction'' feature. This feature is
53 currently incompatible with the ``extract to different
54 directory'' feature and remains disabled by
55 default.
56
57
58 __Note that self-extracting archives made with__
59 ''unzipsfx'' __are no more (or less) portable across
60 different operating systems than is the__ ''unzip''
61 __executable itself.__ In general a self-extracting
62 archive made on a particular Unix system, for example, will
63 only self-extract under the same flavor of Unix. Regular
64 ''unzip'' may still be used to extract the embedded
65 archive as with any normal zipfile, although it will
66 generate a harmless warning about extra bytes at the
67 beginning of the zipfile. ''Despite this'', however, the
68 self-extracting archive is technically ''not'' a valid
69 ZIP archive, and PKUNZIP may be unable to test or extract
70 it. This limitation is due to the simplistic manner in which
71 the archive is created; the internal directory structure is
72 not updated to reflect the extra bytes prepended to the
73 original zipfile.
74 !!ARGUMENTS
75
76
77 [[''file(s)'']
78
79
80 An optional list of archive members to be processed. Regular
81 expressions (wildcards) similar to those in Unix
82 egrep(1) may be used to match multiple members. These
83 wildcards may contain:
84
85
86 *
87
88
89 matches a sequence of 0 or more characters
90
91
92 ?
93
94
95 matches exactly 1 character
96
97
98 [[...]
99
100
101 matches any single character found inside the brackets;
102 ranges are specified by a beginning character, a hyphen, and
103 an ending character. If an exclamation point or a caret (`!'
104 or `^') follows the left bracket, then the range of
105 characters within the brackets is complemented (that is,
106 anything ''except'' the characters inside the brackets is
107 considered a match).
108
109
110 (Be sure to quote any character that might otherwise be
111 interpreted or modified by the operating system,
112 particularly under Unix and VMS.)
113
114
115 [[__-x__ ''xfile(s)'']
116
117
118 An optional list of archive members to be excluded from
119 processing. Since wildcard characters match directory
120 separators (`/'), this option may be used to exclude any
121 files that are in subdirectories. For example, ``foosfx
122 *.[[ch] -x */*'' would extract all C source files in the
123 main directory, but none in any subdirectories. Without the
124 __-x__ option, all C source files in all directories
125 within the zipfile would be extracted.
126
127
128 If ''unzipsfx'' is compiled with SFX_EXDIR defined, the
129 following option is also enabled:
130
131
132 [[__-d__ ''exdir'']
133
134
135 An optional directory to which to extract files. By default,
136 all files and subdirectories are recreated in the current
137 directory; the __-d__ option allows extraction in an
138 arbitrary directory (always assuming one has permission to
139 write to the directory). The option and directory may be
140 concatenated without any white space between them, but note
141 that this may cause normal shell behavior to be suppressed.
142 In particular, ``-d ~'' (tilde) is expanded by Unix
143 C shells into the name of the user's home directory, but
144 ``-d~'' is treated as a literal subdirectory
145 ``__~__'' of the current directory.
146 !!OPTIONS
147
148
149 ''unzipsfx'' supports the following ''unzip''(1L)
150 options: __-c__ and __-p__ (extract to standard
151 output/screen), __-f__ and __-u__ (freshen and update
152 existing files upon extraction), __-t__ (test archive)
153 and __-z__ (print archive comment). All normal listing
154 options (__-l__, __-v__ and __-Z__) have been
155 removed, but the testing option (__-t__) may be used as a
156 ``poor man's'' listing. Alternatively, those creating
157 self-extracting archives may wish to include a short listing
158 in the zipfile comment.
159
160
161 See ''unzip''(1L) for a more complete description of
162 these options.
163 !!MODIFIERS
164
165
166 ''unzipsfx'' currently supports all ''unzip''(1L)
167 modifiers: __-a__ (convert text files), __-n__ (never
168 overwrite), __-o__ (overwrite without prompting),
169 __-q__ (operate quietly), __-C__ (match names
170 case-insensitively), __-L__ (convert uppercase-OS names
171 to lowercase), __-j__ (junk paths) and __-V__ (retain
172 version numbers); plus the following operating-system
173 specific options: __-X__ (restore VMS owner/protection
174 info), __-s__ (convert spaces in filenames to underscores
175 [[DOS, OS/2, NT]) and __-$__ (restore volume label [[DOS,
176 OS/2, NT, Amiga]).
177
178
179 (Support for regular ASCII text-conversion may be removed in
180 future versions, since it is simple enough for the archive's
181 creator to ensure that text files have the appropriate
182 format for the local OS. EBCDIC conversion will of course
183 continue to be supported since the zipfile format implies
184 ASCII storage of text files.)
185
186
187 See ''unzip''(1L) for a more complete description of
188 these modifiers.
189 !!ENVIRONMENT OPTIONS
190
191
192 ''unzipsfx'' uses the same environment variables as
193 ''unzip''(1L) does, although this is likely to be an
194 issue only for the person creating and testing the
195 self-extracting archive. See ''unzip''(1L) for
196 details.
197 !!DECRYPTION
198
199
200 Decryption is supported exactly as in ''unzip''(1L); that
201 is, interactively with a non-echoing prompt for the
202 password(s). See ''unzip''(1L) for details. Once again,
203 note that if the archive has no encrypted files there is no
204 reason to use a version of ''unzipsfx'' with decryption
205 support; that only adds to the size of the
206 archive.
207 !!AUTORUN COMMAND
208
209
210 When ''unzipsfx'' was compiled with CHEAP_SFX_AUTORUN
211 defined, a simple ``command autorun'' feature is supported.
212 You may enter a command into the Zip archive comment, using
213 the following format:
214
215
216 $AUTORUN$
217
218
219 When ''unzipsfxP recognizes the ``$AUTORUN$
220 '' __-q__
221 ''option, autorun commands are never
222 executed.''
223
224
225 In case the archive comment contains additonal lines of
226 text, the remainder of the archive comment following the
227 first line is displayed normally, unless quiet operation was
228 requested by supplying a __-q__ option.
229 !!EXAMPLES
230
231
232 To create a self-extracting archive ''letters'' from a
233 regular zipfile ''letters.zip'' and change the new
234 archive's permissions to be world-executable under
235 Unix:
236
237
238 cat unzipsfx letters.zip
239
240
241 To create the same archive under MS-DOS, OS/2 or NT (note
242 the use of the __/b__ [[binary] option to the ''copy''
243 command):
244
245
246 copy /b unzipsfx.exe+letters.zip letters.exe
247 zip -A letters.exe
248
249
250 Under VMS:
251
252
253 copy unzipsfx.exe,letters.zip letters.exe
254 letters ==
255
256
257 (The VMS ''append'' command may also be used. The second
258 command installs the new program as a ``foreign command''
259 capable of taking arguments. The third line assumes that Zip
260 is already installed as a foreign command.) Under
261 AmigaDOS:
262
263
264 MakeSFX letters letters.zip UnZipSFX
265
266
2 perry 267 (MakeSFX is included with the !UnZip source distribution and
1 perry 268 with Amiga binary distributions. ``zip -A'' doesn't
269 work on Amiga self-extracting archives.) To test (or list)
270 the newly created self-extracting archive:
271
272
273 letters -t
274
275
276 To test ''letters'' quietly, printing only a summary
277 message indicating whether the archive is OK or
278 not:
279
280
281 letters -tqq
282
283
284 To extract the complete contents into the current directory,
285 recreating all files and subdirectories as
286 necessary:
287
288
289 letters
290
291
292 To extract all *.txt files (in Unix quote the
293 `*'):
294
295
296 letters *.txt
297
298
299 To extract everything ''except'' the *.txt
300 files:
301
302
303 letters -x *.txt
304
305
306 To extract only the README file to standard output (the
307 screen):
308
309
310 letters -c README
311
312
313 To print only the zipfile comment:
314
315
316 letters -z
317 !!LIMITATIONS
318
319
320 The principle and fundamental limitation of ''unzipsfx''
321 is that it is not portable across architectures or operating
322 systems, and therefore neither are the resulting archives.
323 For some architectures there is limited portability, however
324 (e.g., between some flavors of Intel-based
325 Unix).
326
327
328 Another problem with the current implementation is that any
329 archive with ``junk'' prepended to the beginning technically
330 is no longer a zipfile (unless zip(1) is used to
331 adjust the zipfile offsets appropriately, as noted above).
332 unzip(1) takes note of the prepended bytes and
333 ignores them since some file-transfer protocols, notably
2 perry 334 !MacBinary, are also known to prepend junk. But PKWARE's
1 perry 335 archiver suite may not be able to deal with the modified
336 archive unless its offsets have been adjusted.
337
338
339 ''unzipsfx'' has no knowledge of the user's PATH, so in
340 general an archive must either be in the current directory
341 when it is invoked, or else a full or relative path must be
342 given. If a user attempts to extract the archive from a
343 directory in the PATH other than the current one,
344 ''unzipsfx'' will print a warning to the effect, ``can't
345 find myself.'' This is always true under Unix and may be
346 true in some cases under MS-DOS, depending on the compiler
347 used (Microsoft C fully qualifies the program name, but
348 other compilers may not). Under OS/2 and NT there are
349 operating-system calls available that provide the full path
350 name, so the archive may be invoked from anywhere in the
351 user's path. The situation is not known for AmigaDOS, Atari
352 TOS, MacOS, etc.
353
354
355 As noted above, a number of the normal ''unzip''(1L)
356 functions have been removed in order to make ''unzipsfx''
357 smaller: usage and diagnostic info, listing functions and
358 extraction to other directories. Also, only stored and
359 deflated files are supported. The latter limitation is
360 mainly relevant to those who create SFX archives,
361 however.
362
363
364 VMS users must know how to set up self-extracting archives
365 as foreign commands in order to use any of ''unzipsfx'''s
366 options. This is not necessary for simple extraction, but
367 the command to do so then becomes, e.g., ``run
368 letters'' (to continue the examples given
369 above).
370
371
372 ''unzipsfx'' on the Amiga requires the use of a special
373 program, MakeSFX, in order to create working self-extracting
374 archives; simple concatenation does not work. (For
375 technically oriented users, the attached archive is defined
376 as a ``debug hunk.'') There may be compatibility problems
377 between the ROM levels of older Amigas and newer
378 ones.
379
380
381 All current bugs in ''unzip''(1L) exist in
382 ''unzipsfx'' as well.
383 !!DIAGNOSTICS
384
385
386 ''unzipsfx'''s exit status (error level) is identical to
387 that of ''unzip''(1L); see the corresponding man
388 page.
389 !!SEE ALSO
390
391
392 ''funzip''(1L), ''unzip''(1L), ''zip''(1L),
393 ''zipcloak''(1L), ''zipgrep''(1L), ''zipinfo''(1L),
394 ''zipnote''(1L), ''zipsplit''(1L)
395 !!URL
396
397
398 The Info-ZIP home page is currently at
399
400
401 http://www.info-zip.org/pub/infozip/
402
403
404 or
405
406
407 ftp://ftp.info-zip.org/pub/infozip/ .
408 !!AUTHORS
409
410
411 Greg Roelofs was responsible for the basic modifications to
2 perry 412 !UnZip necessary to create UnZipSFX. See ''unzip''(1L) for
1 perry 413 the current list of Zip-Bugs authors, or the file CONTRIBS
2 perry 414 in the !UnZip source distribution for the full list of
1 perry 415 Info-ZIP contributors.
416 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.