File: unzipsfx.txt

package info (click to toggle)
unzip 5.52-9etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 5,776 kB
  • ctags: 7,140
  • sloc: ansic: 49,152; cpp: 3,978; makefile: 2,310; asm: 1,583; sh: 91
file content (342 lines) | stat: -rw-r--r-- 15,236 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342

UNZIPSFX(1L)                                         UNZIPSFX(1L)

NAME
       unzipsfx  -  self-extracting  stub  for  prepending to ZIP
       archives

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

DESCRIPTION
       unzipsfx is a modified version of unzip(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,  unzipsfx
       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 unzip
       have been removed.  Among these are the  usage  (or  help)
       screen,  the listing and diagnostic functions (-l and -v),
       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 com-
       pile-time option adds a simple ``run command after extrac-
       tion''  feature.   This  feature is currently incompatible
       with the ``extract to different  directory''  feature  and
       remains disabled by default.

       Note  that self-extracting archives made with unzipsfx are
       no more (or less) portable across different operating sys-
       tems  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.

ARGUMENTS
       [file(s)]
              An  optional  list  of  archive  members to be pro-
              cessed.  Regular expressions (wildcards) similar to
              those  in  Unix  egrep(1)  may  be  used  to  match

Info-ZIP             28 February 2005 (v5.52)                   1

UNZIPSFX(1L)                                         UNZIPSFX(1L)

              multiple members.  These wildcards 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 (`!' or `^') 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).

              (Be sure to quote any character that  might  other-
              wise  be  interpreted  or modified by the operating
              system, particularly under Unix and VMS.)

       [-x xfile(s)]
              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, ``foosfx *.[ch] -x */*'' would extract
              all  C source files in the main directory, but none
              in any subdirectories.  Without the -x option,  all
              C  source  files in all directories within the zip-
              file would be extracted.

       If unzipsfx is compiled with SFX_EXDIR defined,  the  fol-
       lowing option is also enabled:

       [-d exdir]
              An  optional  directory  to which to extract files.
              By default, all files and subdirectories are recre-
              ated in the current directory; the -d option allows
              extraction in an arbitrary directory (always assum-
              ing  one has permission to write to the directory).
              The option and directory may be concatenated  with-
              out  any  white  space  between them, but note that
              this may cause normal shell  behavior  to  be  sup-
              pressed.    In   particular,  ``-d ~''  (tilde)  is
              expanded by Unix C shells  into  the  name  of  the
              user's  home directory, but ``-d~'' is treated as a
              literal subdirectory ``~'' of  the  current  direc-
              tory.

OPTIONS
       unzipsfx supports the following unzip(1L) options:  -c and
       -p (extract to standard output/screen), -f and -u (freshen
       and  update  existing  files  upon  extraction),  -t (test
       archive) and  -z  (print  archive  comment).   All  normal

Info-ZIP             28 February 2005 (v5.52)                   2

UNZIPSFX(1L)                                         UNZIPSFX(1L)

       listing options (-l, -v and -Z) have been removed, but the
       testing option (-t) may be used as a ``poor man's''  list-
       ing.    Alternatively,   those   creating  self-extracting
       archives may wish to include a short listing in  the  zip-
       file comment.

       See  unzip(1L)  for  a  more complete description of these
       options.

MODIFIERS
       unzipsfx currently supports all unzip(1L)  modifiers:   -a
       (convert  text files), -n (never overwrite), -o (overwrite
       without prompting), -q (operate quietly), -C (match  names
       case-insensitively),  -L  (convert  uppercase-OS  names to
       lowercase), -j (junk paths) and -V  (retain  version  num-
       bers);   plus   the  following  operating-system  specific
       options:  -X (restore VMS owner/protection info), -s (con-
       vert  spaces  in filenames to underscores [DOS, OS/2, NT])
       and -$ (restore volume label [DOS, OS/2, NT, Amiga]).

       (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.

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

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

AUTORUN COMMAND
       When unzipsfx 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:

           $AUTORUN$>[command line string]

       When  unzipsfxP recognizes the ``$AUTORUN$>'' token at the
       beginning of the Zip archive comment, the remainder of the

Info-ZIP             28 February 2005 (v5.52)                   3

UNZIPSFX(1L)                                         UNZIPSFX(1L)

       first line of the comment (until the first newline charac-
       ter) is passed as a shell command to the operating  system
       using  the C rtl ``system'' function. Before executing the
       command, unzipsfxP 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 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 -q option.

EXAMPLES
       To create a self-extracting archive letters from a regular
       zipfile  letters.zip  and change the new archive's permis-
       sions to be world-executable under Unix:

           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):

           copy /b unzipsfx.exe+letters.zip letters.exe
           zip -A letters.exe

       Under VMS:

           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 com-
       mand 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:

           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:

           letters -t

       To test letters quietly, printing only a  summary  message
       indicating whether the archive is OK or not:

           letters -tqq

Info-ZIP             28 February 2005 (v5.52)                   4

UNZIPSFX(1L)                                         UNZIPSFX(1L)

       To  extract  the complete contents into the current direc-
       tory, recreating all files and  subdirectories  as  neces-
       sary:

           letters

       To extract all *.txt files (in Unix quote the `*'):

           letters *.txt

       To extract everything except the *.txt files:

           letters -x *.txt

       To  extract  only  the README file to standard output (the
       screen):

           letters -c README

       To print only the zipfile comment:

           letters -z

LIMITATIONS
       The principle and fundamental limitation  of  unzipsfx  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, how-
       ever (e.g., between some flavors of Intel-based Unix).

       Another problem with the current  implementation  is  that
       any archive with ``junk'' prepended to the beginning tech-
       nically 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 MacBi-
       nary, 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  gen-
       eral  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 operat-
       ing-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.

Info-ZIP             28 February 2005 (v5.52)                   5

UNZIPSFX(1L)                                         UNZIPSFX(1L)

       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 extrac-
       tion to other directories.  Also, only stored and deflated
       files are supported.  The latter limitation is mainly rel-
       evant 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  pro-
       gram,  MakeSFX, in order to create working self-extracting
       archives; simple concatenation does not work.  (For  tech-
       nically 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.

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

SEE ALSO
       funzip(1L), unzip(1L), zip(1L), zipcloak(1L), zipgrep(1L),
       zipinfo(1L), zipnote(1L), zipsplit(1L)

URL
       The Info-ZIP home page is currently at
           http://www.info-zip.org/pub/infozip/
       or
           ftp://ftp.info-zip.org/pub/infozip/ .

AUTHORS
       Greg  Roelofs  was responsible for the basic modifications
       to UnZip necessary to create UnZipSFX.  See unzip(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.

Info-ZIP             28 February 2005 (v5.52)                   6