"SfR Fresh" - the SfR Freeware/Shareware Archive 
Member "unzipsfx.txt" of archive unz552xN.exe:
As a special service "SfR Fresh" has tried to format the requested source page into HTML format using source code syntax highlighting with prefixed line numbers.
Alternatively you can here view or download the uninterpreted source code file.
That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
1
2 UNZIPSFX(1L) UNZIPSFX(1L)
3
4 NAME
5 unzipsfx - self-extracting stub for prepending to ZIP
6 archives
7
8 SYNOPSIS
9 <name of unzipsfx+archive combo> [-cfptuz[ajnoqsCLV$]]
10 [file(s) ... [-x xfile(s) ...]]
11
12 DESCRIPTION
13 unzipsfx is a modified version of unzip(1L) designed to be
14 prepended to existing ZIP archives in order to form self-
15 extracting archives. Instead of taking its first non-flag
16 argument to be the zipfile(s) to be extracted, unzipsfx
17 seeks itself under the name by which it was invoked and
18 tests or extracts the contents of the appended archive.
19 Because the executable stub adds bulk to the archive (the
20 whole purpose of which is to be as small as possible), a
21 number of the less-vital capabilities in regular unzip
22 have been removed. Among these are the usage (or help)
23 screen, the listing and diagnostic functions (-l and -v),
24 the ability to decompress older compression formats (the
25 ``reduce,'' ``shrink'' and ``implode'' methods). The
26 ability to extract to a directory other than the current
27 one can be selected as a compile-time option, which is now
28 enabled by default since UnZipSFX version 5.5. Similary,
29 decryption is supported as a compile-time option but
30 should be avoided unless the attached archive contains
31 encrypted files. Starting with release 5.5, another com-
32 pile-time option adds a simple ``run command after extrac-
33 tion'' feature. This feature is currently incompatible
34 with the ``extract to different directory'' feature and
35 remains disabled by default.
36
37 Note that self-extracting archives made with unzipsfx are
38 no more (or less) portable across different operating sys-
39 tems than is the unzip executable itself. In general a
40 self-extracting archive made on a particular Unix system,
41 for example, will only self-extract under the same flavor
42 of Unix. Regular unzip may still be used to extract the
43 embedded archive as with any normal zipfile, although it
44 will generate a harmless warning about extra bytes at the
45 beginning of the zipfile. Despite this, however, the
46 self-extracting archive is technically not a valid ZIP
47 archive, and PKUNZIP may be unable to test or extract it.
48 This limitation is due to the simplistic manner in which
49 the archive is created; the internal directory structure
50 is not updated to reflect the extra bytes prepended to the
51 original zipfile.
52
53 ARGUMENTS
54 [file(s)]
55 An optional list of archive members to be pro-
56 cessed. Regular expressions (wildcards) similar to
57 those in Unix egrep(1) may be used to match
58
59 Info-ZIP 28 February 2005 (v5.52) 1
60
61 UNZIPSFX(1L) UNZIPSFX(1L)
62
63 multiple members. These wildcards may contain:
64
65 * matches a sequence of 0 or more characters
66
67 ? matches exactly 1 character
68
69 [...] matches any single character found inside
70 the brackets; ranges are specified by a
71 beginning character, a hyphen, and an ending
72 character. If an exclamation point or a
73 caret (`!' or `^') follows the left bracket,
74 then the range of characters within the
75 brackets is complemented (that is, anything
76 except the characters inside the brackets is
77 considered a match).
78
79 (Be sure to quote any character that might other-
80 wise be interpreted or modified by the operating
81 system, particularly under Unix and VMS.)
82
83 [-x xfile(s)]
84 An optional list of archive members to be excluded
85 from processing. Since wildcard characters match
86 directory separators (`/'), this option may be used
87 to exclude any files that are in subdirectories.
88 For example, ``foosfx *.[ch] -x */*'' would extract
89 all C source files in the main directory, but none
90 in any subdirectories. Without the -x option, all
91 C source files in all directories within the zip-
92 file would be extracted.
93
94 If unzipsfx is compiled with SFX_EXDIR defined, the fol-
95 lowing option is also enabled:
96
97 [-d exdir]
98 An optional directory to which to extract files.
99 By default, all files and subdirectories are recre-
100 ated in the current directory; the -d option allows
101 extraction in an arbitrary directory (always assum-
102 ing one has permission to write to the directory).
103 The option and directory may be concatenated with-
104 out any white space between them, but note that
105 this may cause normal shell behavior to be sup-
106 pressed. In particular, ``-d ~'' (tilde) is
107 expanded by Unix C shells into the name of the
108 user's home directory, but ``-d~'' is treated as a
109 literal subdirectory ``~'' of the current direc-
110 tory.
111
112 OPTIONS
113 unzipsfx supports the following unzip(1L) options: -c and
114 -p (extract to standard output/screen), -f and -u (freshen
115 and update existing files upon extraction), -t (test
116 archive) and -z (print archive comment). All normal
117
118 Info-ZIP 28 February 2005 (v5.52) 2
119
120 UNZIPSFX(1L) UNZIPSFX(1L)
121
122 listing options (-l, -v and -Z) have been removed, but the
123 testing option (-t) may be used as a ``poor man's'' list-
124 ing. Alternatively, those creating self-extracting
125 archives may wish to include a short listing in the zip-
126 file comment.
127
128 See unzip(1L) for a more complete description of these
129 options.
130
131 MODIFIERS
132 unzipsfx currently supports all unzip(1L) modifiers: -a
133 (convert text files), -n (never overwrite), -o (overwrite
134 without prompting), -q (operate quietly), -C (match names
135 case-insensitively), -L (convert uppercase-OS names to
136 lowercase), -j (junk paths) and -V (retain version num-
137 bers); plus the following operating-system specific
138 options: -X (restore VMS owner/protection info), -s (con-
139 vert spaces in filenames to underscores [DOS, OS/2, NT])
140 and -$ (restore volume label [DOS, OS/2, NT, Amiga]).
141
142 (Support for regular ASCII text-conversion may be removed
143 in future versions, since it is simple enough for the
144 archive's creator to ensure that text files have the
145 appropriate format for the local OS. EBCDIC conversion
146 will of course continue to be supported since the zipfile
147 format implies ASCII storage of text files.)
148
149 See unzip(1L) for a more complete description of these
150 modifiers.
151
152 ENVIRONMENT OPTIONS
153 unzipsfx uses the same environment variables as unzip(1L)
154 does, although this is likely to be an issue only for the
155 person creating and testing the self-extracting archive.
156 See unzip(1L) for details.
157
158 DECRYPTION
159 Decryption is supported exactly as in unzip(1L); that is,
160 interactively with a non-echoing prompt for the pass-
161 word(s). See unzip(1L) for details. Once again, note
162 that if the archive has no encrypted files there is no
163 reason to use a version of unzipsfx with decryption sup-
164 port; that only adds to the size of the archive.
165
166 AUTORUN COMMAND
167 When unzipsfx was compiled with CHEAP_SFX_AUTORUN defined,
168 a simple ``command autorun'' feature is supported. You may
169 enter a command into the Zip archive comment, using the
170 following format:
171
172 $AUTORUN$>[command line string]
173
174 When unzipsfxP recognizes the ``$AUTORUN$>'' token at the
175 beginning of the Zip archive comment, the remainder of the
176
177 Info-ZIP 28 February 2005 (v5.52) 3
178
179 UNZIPSFX(1L) UNZIPSFX(1L)
180
181 first line of the comment (until the first newline charac-
182 ter) is passed as a shell command to the operating system
183 using the C rtl ``system'' function. Before executing the
184 command, unzipsfxP displays the command on the console and
185 prompts the user for confirmation. When the user has
186 switched off prompting by specifying the -q option,
187 autorun commands are never executed.
188
189 In case the archive comment contains additonal lines of
190 text, the remainder of the archive comment following the
191 first line is displayed normally, unless quiet operation
192 was requested by supplying a -q option.
193
194 EXAMPLES
195 To create a self-extracting archive letters from a regular
196 zipfile letters.zip and change the new archive's permis-
197 sions to be world-executable under Unix:
198
199 cat unzipsfx letters.zip > letters
200 chmod 755 letters
201 zip -A letters
202
203 To create the same archive under MS-DOS, OS/2 or NT (note
204 the use of the /b [binary] option to the copy command):
205
206 copy /b unzipsfx.exe+letters.zip letters.exe
207 zip -A letters.exe
208
209 Under VMS:
210
211 copy unzipsfx.exe,letters.zip letters.exe
212 letters == "$currentdisk:[currentdir]letters.exe"
213 zip -A letters.exe
214
215 (The VMS append command may also be used. The second com-
216 mand installs the new program as a ``foreign command''
217 capable of taking arguments. The third line assumes that
218 Zip is already installed as a foreign command.) Under
219 AmigaDOS:
220
221 MakeSFX letters letters.zip UnZipSFX
222
223 (MakeSFX is included with the UnZip source distribution
224 and with Amiga binary distributions. ``zip -A'' doesn't
225 work on Amiga self-extracting archives.) To test (or
226 list) the newly created self-extracting archive:
227
228 letters -t
229
230 To test letters quietly, printing only a summary message
231 indicating whether the archive is OK or not:
232
233 letters -tqq
234
235 Info-ZIP 28 February 2005 (v5.52) 4
236
237 UNZIPSFX(1L) UNZIPSFX(1L)
238
239 To extract the complete contents into the current direc-
240 tory, recreating all files and subdirectories as neces-
241 sary:
242
243 letters
244
245 To extract all *.txt files (in Unix quote the `*'):
246
247 letters *.txt
248
249 To extract everything except the *.txt files:
250
251 letters -x *.txt
252
253 To extract only the README file to standard output (the
254 screen):
255
256 letters -c README
257
258 To print only the zipfile comment:
259
260 letters -z
261
262 LIMITATIONS
263 The principle and fundamental limitation of unzipsfx is
264 that it is not portable across architectures or operating
265 systems, and therefore neither are the resulting archives.
266 For some architectures there is limited portability, how-
267 ever (e.g., between some flavors of Intel-based Unix).
268
269 Another problem with the current implementation is that
270 any archive with ``junk'' prepended to the beginning tech-
271 nically is no longer a zipfile (unless zip(1) is used to
272 adjust the zipfile offsets appropriately, as noted above).
273 unzip(1) takes note of the prepended bytes and ignores
274 them since some file-transfer protocols, notably MacBi-
275 nary, are also known to prepend junk. But PKWARE's
276 archiver suite may not be able to deal with the modified
277 archive unless its offsets have been adjusted.
278
279 unzipsfx has no knowledge of the user's PATH, so in gen-
280 eral an archive must either be in the current directory
281 when it is invoked, or else a full or relative path must
282 be given. If a user attempts to extract the archive from
283 a directory in the PATH other than the current one,
284 unzipsfx will print a warning to the effect, ``can't find
285 myself.'' This is always true under Unix and may be true
286 in some cases under MS-DOS, depending on the compiler used
287 (Microsoft C fully qualifies the program name, but other
288 compilers may not). Under OS/2 and NT there are operat-
289 ing-system calls available that provide the full path
290 name, so the archive may be invoked from anywhere in the
291 user's path. The situation is not known for AmigaDOS,
292 Atari TOS, MacOS, etc.
293
294 Info-ZIP 28 February 2005 (v5.52) 5
295
296 UNZIPSFX(1L) UNZIPSFX(1L)
297
298 As noted above, a number of the normal unzip(1L) functions
299 have been removed in order to make unzipsfx smaller:
300 usage and diagnostic info, listing functions and extrac-
301 tion to other directories. Also, only stored and deflated
302 files are supported. The latter limitation is mainly rel-
303 evant to those who create SFX archives, however.
304
305 VMS users must know how to set up self-extracting archives
306 as foreign commands in order to use any of unzipsfx's
307 options. This is not necessary for simple extraction, but
308 the command to do so then becomes, e.g., ``run letters''
309 (to continue the examples given above).
310
311 unzipsfx on the Amiga requires the use of a special pro-
312 gram, MakeSFX, in order to create working self-extracting
313 archives; simple concatenation does not work. (For tech-
314 nically oriented users, the attached archive is defined as
315 a ``debug hunk.'') There may be compatibility problems
316 between the ROM levels of older Amigas and newer ones.
317
318 All current bugs in unzip(1L) exist in unzipsfx as well.
319
320 DIAGNOSTICS
321 unzipsfx's exit status (error level) is identical to that
322 of unzip(1L); see the corresponding man page.
323
324 SEE ALSO
325 funzip(1L), unzip(1L), zip(1L), zipcloak(1L), zipgrep(1L),
326 zipinfo(1L), zipnote(1L), zipsplit(1L)
327
328 URL
329 The Info-ZIP home page is currently at
330 http://www.info-zip.org/pub/infozip/
331 or
332 ftp://ftp.info-zip.org/pub/infozip/ .
333
334 AUTHORS
335 Greg Roelofs was responsible for the basic modifications
336 to UnZip necessary to create UnZipSFX. See unzip(1L) for
337 the current list of Zip-Bugs authors, or the file CONTRIBS
338 in the UnZip source distribution for the full list of
339 Info-ZIP contributors.
340
341 Info-ZIP 28 February 2005 (v5.52) 6
342