Está en la página 1de 34

Microsoft MakeCAB Users Guide

Copyright 1997 Microsoft Corporation. All rights reserved.

Abstract This document describes the Microsoft MakeCAB program, including detailed example applications, and the Microsoft Extract program. MakeCAB can create cabinet files, including sets cabinet files which span multiple cabinets or multiple diskettes. Extract can view or retrieve the files which are stored inside cabinet files.

Microsoft MakeCAB Users G ide

Table of Contents

!age "

March "#$ 1997

Microsoft MakeCAB Users G ide

Overview
MakeCAB is a lossless data co%pression tool that can &e sed for a 'ide variety of p rposes. Altho gh it 'as originally designed for se &y set p progra%s$ it can also &e sed in al%ost any sit ation 'here lossless data co%pression is re( ired. MakeCAB has three key feat res) 1* storing % ltiple files in a single cabinet !CAB"# file$ "* perfor%ing co%pression across file &o ndaries$ and +* per%itting files to span ca&inets. ,hile e-isting prod cts s ch as !./0!$ 12A3C$ and A34$ s pport so%e of these feat res$ co%&ining all three does not appear to &e co%%on practice. MakeCAB also s pports self5e-tracting archives$ &y si%ply concatenating a ca&inet file to 6783AC8.676. 9epending pon the n %&er of files to &e co%pressed$ and the access patterns e-pected :se( ential or rando% access; 'hether %ost of the files 'ill &e re( ested at once or only a s%all portion of the%*$ MakeCAB can &e instr cted to & ild ca&inet files in different 'ays. <ne key concept in MakeCAB is the folder. A folder is a collection of one or %ore files 'hich are co%pressed together$ as a single entity. 8he ca&inet file for%at is capa&le of s pporting % ltiple for%s of co%pression. At this ti%e$ M=/0! and 1/7 are the co%pression for%ats s pported &y Microsoft. <ther co%pression for%ats are possi&le in the f t re. 8he follo'ing sections provide case st dies of several possible 'ays that MakeCAB %ight &e sed. 8hese are only provided to sti% late yo r i%agination 55 they are not the only 'ays in 'hich MakeCAB can &e sed>

Case 1: MakeCAB for Setup Programs


=ince MakeCAB 'as designed 'ith set p progra%s in %ind$ it has a great deal of po'er and fle-i&ility to tradeoff co%pressed si?e against speed of rando% access to files. 8he pri%ary i%pact of MakeCAB is to %ini%i?e the n %&er of diskettes re( ired to distri& te a prod ct$ there&y %ini%i?ing the Cost of Goods =old :C<G=*. 0n order for MakeCAB to & ild the disk i%ages for a prod ct$ a directive file$ or 99@$ 'hich specifies the list of files in a prod ct$ and any constraints on 'hich disks certain files sho ld &e located$ % st &e created. 8he sa%e directive file can even &e sed for all the vario s locali?ed versions of a prod ct$ since directive files s pport para%eteri?ation.

Characteristics of a Setup Program


1* Mini%i?ing disk co nt is very i%portant$ since it saves %oney in prod ction costs "* @iles are accessed se( entially +* Most files are accessed

MakeCAB Application
8he distri& tion disks for a typical application prod ct prod ced &y MakeCAB %ight look si%ilar to the follo'ing)

!age +

March "#$ 1997

Microsoft MakeCAB Users G ide Figure : Distribution disk layout

Disk 1

=68U!.676 =68U!.0A@ 67C61.1 67C61."

Disk 2

Disk N

67C61.A

=68U!.676 is the set p progra%$ and =68U!.0A@ is a file generated &y MakeCAB 'hich g ides the operation of the set p progra% :'hich files are needed for 'hich options$ and on 'hich disk and in 'hich ca&inet file a file is contained*. All of the re%aining prod ct files are contained in the ca&inet files 67C61.1 thro gh 67C61.A :A %ight &e 7$ for e-a%ple*. 8o prod ce this disk layo t 'ith MakeCAB$ a 99@ is prepared 'hich lists all of the files forthe prod ct$ along 'ith so%e optional MakeCAB settings to control para%eters s ch as) 1* the capacity of the disks 'hich are &eing sed$ "* the na%ing convention of the ca&inet files $ +* the visi&le : ser5reada&le* la&els on each disk$ B* ho' % ch rando% access is desired for files 'ithin a ca&inet. 8he follo'ing is an e-a%ple of a 99@ that %ight &e appropriate)
;*** MakeCAB Directive file example ; .OPTION EXPLICIT .%et .%et .%et .%et ."et .%et

; Ge erate err!r" !

varia#le t$p!"

Di"kLa#el&'%et(p ; La#el !f fir"t )i"k Di"kLa#el*'Pr!+ram ; La#el !f "ec! ) )i"k Di"kLa#el,'-Pr!+ram C! ti (e); La#el !f t.ir) )i"k Ca#i etNameTemplate'EXCEL.* ; EXCEL.&/ EXCEL.*/ etc. Di"kDirect!r$Template'Di"k* ; )i"k&/ )i"k*/ etc. MaxDi"k%i0e'&.11M ; ,.2- )i"k" t.e fir"t )i"k etc. attr" a" i" a" i"

;** %et(p.exe a ) "et(p.i f are place) ( c!mpre""e) i .%et Ca#i et'!ff .%et C!mpre""'!ff .%et I fAttr' ; T(r !ff rea)3! l$/ #i 4"et(p.exe ; 5("t c!p$ %ET6P.EXE #i 4"et(p.i f ; 5("t c!p$ %ET6P.IN7

;** T.e re"t !f t.e file" are "t!re)/ c!mpre""e)/ i ca#i et file" .%et Ca#i et'! .%et C!mpre""'! #i 4excel.exe ; Bi+ EXE/ 8ill "pa ca#i et" #i 4excel..lp #i 4!lecli.)ll #i 4!le"rv.)ll ;... ; Ma $ m!re file" ;*** 9t.e e ): ; T.at;" it

!age B

March "#$ 1997

Microsoft MakeCAB Users G ide

Ao'$ yo r n MakeCAB to create the disk layo t)


MakeCAB <f excel.))f

MakeCAB 'ill create directories 9isk1$ 9isk"$ etc. to hold the files for each disk$ and 'ill copy nco%pressed files or create ca&inet files :as appropriate* in each directory. 8he file =68U!.3!8 'ill &e 'ritten to the c rrent directory :this can &e overridden* 'ith a s %%ary of 'hat MakeCAB did$ and the file =68U!.0A@ 'ill contain details on every disk and ca&inet created$ incl ding a list of 'here each file 'as placed.

Case 2: MakeCAB for a 2

M! Source Code Arc"ive

8he Microsoft 9evelopers Aet'ork :M=9A* C9 incl des over "##M& of so rce code. ,hile nco%pressed this is only 1C+rd of the C9$ that is still too % ch space$ so tight co%pression is desired. 8his is slightly different fro% the =et p case$ ho'ever$ since there is a front5end tool that allo's sers to select sa%ple progra%s and e-pand the% onto the hard disk.

Characteristics of a Source Code Archi e


B* Mini%i?ing space sage is slightly less i%portant D* @iles are accessed so%e'hat rando%ly$ tho gh in gro ps E* <nly a s%all portion of the files 'ill &e accessed at any one ti%e

MakeCAB Application
8he ca&inet files prod ced for the so rce archive need to &e &ig eno gh to provide good co%pression$ & t not so &ig that rando% access speed is sacrificed. 8he challenge is to o&tain a good tradeoff &et'een co%pression and access ti%e.
;*** M%DN %ample %!(rce C!)e MakeCAB Directive file example ; .OPTION EXPLICIT ; Ge erate err!r" ! .%et Ca#i etNameTemplate'M%DN.* ."et Di"kDirect!r$Template'CD=OM .%et MaxDi"k7ileC!( t'&>>> .%et 7!l)er%i0eT.re".!l)'*>>>>> .%et C!mpre""i! T$pe'M%AIP ;** All file" are c!mpre""e) i .%et Ca#i et'! .%et C!mpre""'! f!!.c f!!.. .... ;*** 9t.e e ): ; ; ; ; ;

varia#le t$p!"

M%DN.&/ M%DN.*/ etc. All ca#i et" +! i a "i +le )irect!r$ Limit file c!( t per ca#i et/ "! t.at "ca i + i" !t t!! "l!8 Aim f!r ?*>>@ per f!l)er

ca#i et file"

; T.at;" it

Case #: MakeCAB over a $etwork


Many ti%es$ a soft'are developer 'ill 'ant to ship e-ec ta&les$ li&raries$ or the like across an 0ntranet or the 0nternet. 8hey need a s%all package and an easy 'ay for sers to e-tract data. @or e-a%ple$ 4avaF8MG developers %ay 'ant to ship large li&raries of classes$ so that ho%e and & siness developers can se those classes in their soft'are.

!age D

March "#$ 1997

Microsoft MakeCAB Users G ide 6783AC8.676$ 'hich e-tracts files fro% CAB files$ recogni?es 'hen it has &een copied to the front of a ca&inet file$ and 'ill a to%atically e-tract the files in that ca&inet file :and any contin ation ca&inet files*. 2ere is ho' this is acco%plished)

7* Create a ca&inet file :or set of ca&inet files* H* !repend 6783AC8.676 to the first ca&inet file :do not prepend 6783AC8.676 to any other ca&inet files in
the set*

9* 9istri& te the self5e-tracting ca&inet :and any s &se( ent ca&inets*


6-a%ple 1)
MakeCAB <f "elf.))f ; B(il) ca#i et file "et "elf&.ca#/ "elf*.ca# c!p$ <# extract.exeB"elf&.ca# "elf.exe ; "elf.exe i" "elf3extracti +

MakeCAB %e&ivera!&es
8he follo'ing ta&le is a list of all the li&raries and progra%s that are part of MakeCAB)

@ile MA.6CAB.676 @90.10B 6783AC8.676 @C0.10B

Contents Co%%and5line tool to perfor% disk layo t : ses @C0.10B* @ile 9eco%pression 0nterface li&rary. Co%%and5line tool to e-pand files : ses @90.10B* @ile Co%pression 0nterface li&rary.

MakeCAB Goa&s
o o o !rovide e-cellent co%pression ratio and deco%pression speed =i%plify prod ction of disk layo ts for prod cts !rovide co%%and5line tools and link li&raries for all Microsoft platfor%s

MakeCAB Optimi'i$g a$d (u$i$g Savi$g %iskettes


@or a prod ct shipped on floppy disks$ it is very i%portant to %ini%i?e the n %&er of disks shipped per prod ct> As a &ack5of5the5envelope calc lation$ if each disk cost a dollar and one %illion nits 'ere shipped$ then each disk saved 'o ld save I1 %illion. 8he follo'ing pse do5code s ggests a process yo %ight follo' as yo strive to keep yo r Cost of Goods =old :C<G=* to a %ini% %)
+et i itial pr!)(ct file"; 8.ile C.ave !t $et ".ippe)D C!mpre"" file "et ("i +E C!mpre""i! T$pe'LAX C!mpre""i! Mem!r$'*& If ear a )i"k #!( )ar$ C! "i)er t!""i + file" t! "ave a )i"k Ce"peciall$ clipart F "ample"GD If ear ".ippi + =elax 7!l)er%i0eT.re".!l) t! impr!ve acce"" time at )ec!mpre"". e )38.ile %.ip itG

!age E

March "#$ 1997

Microsoft MakeCAB Users G ide

(u$i$g Access (ime vs) Compressio$ *atio


MakeCAB introd ces the concept of a folder to refer to a contig o s set of co%pressed &ytes. 8o deco%press a file fro% a ca&inet$ @90.10B :called &y yo r =68U!.676 and 6783AC8.676* finds the folder that the file starts in$ and then % st read and decompress all the &ytes in that folder fro% the start p thro gh and incl ding the desired file. @or e-a%ple$ if the file @<<.676 is at the end of a 1.BBM& folder on a 1.BBM diskette$ then @90.10B % st read the entire diskette and deco%press all the data. 8his is a&o t the 'orst access ti%e possi&le. By contrast$ if @<<.676 'ere at the start of a folder :regardless of ho' large the folder is*$ then it 'o ld &e read and deco%pressed 'ith no e-tra overhead. =o$ 'hy 'o ld one not al'ays =et @older@ileCo nt8hresholdJ1K Beca se doing so 'o ld reset the co%pression history after each file$ res lting in a poor co%pression ratio. MakeCAB provides several varia&les and directives to provide very fine control over these iss es) Laria&leC9irective Ca&inet@ileCo nt8hreshold @older@ileCo nt8hreshold @older=i?e8hreshold Ma-Ca&inet=i?e .Ae' @older .Ae' Ca&inet More Co%pression; =lo'er Access 8i%e Bigger n %&ers Bigger n %&ers Bigger n %&ers Bigger n %&ers 9ont se 9ont se 1ess Co%pression; @aster Access 8i%e 1o'er n %&ers 1o'er n %&ers 1o'er n %&ers 1o'er n %&ers Use often Use often

8he MakeCAB defa lts are config red for a floppy disk layo t$ 'ith the ass %ption that the %ost co%%on scenario is a f ll set p that 'ill e-tract %ost of the files$ so these are the settings) Laria&leC9irective Ca&inet@ileCo nt8hreshold @older@ileCo nt8hreshold @older=i?e8hreshold Ma-Ca&inet=i?e Lal e Unli%ited Unli%ited =a%e as Ma-Ca&inet=i?e =a%e as Ma-9isk=i?e

@or the M=9A so rce archive :M"##M& of sa%ple so rce code$ M+#$### files* that ships on a C953<M$ the follo'ing val es %ight &e a reasona&le tradeoff &et'een co%pression and access ti%e) Laria&leC9irective Ca&inet@ileCo nt8hreshold @older@ileCo nt8hreshold @older=i?e8hreshold Ma-Ca&inet=i?e Lal e "### :=ince 'e have to call @90Copy:* on a ca&inet and 'alk thro gh all the @016 headers$ 'e 'ant this s%all eno gh so that isnt too % ch overhead$ & t large eno gh to keep the n %&er of ca&inets do'n.* Unli%ited :1et @older=i?e8hreshold control folder si?e>* "##. :3epresents E##.5H##. of so rce :ass %ing +)1 or B)1 co%pression ratio* Unli%ited :1et Ca&inet@ileCo nt8hreshold control the ca&inet si?e>*

<f co rse$ if yo are tight for space on yo r C953<M$ yo ll pro&a&ly &oost the FolderSi!eThreshold and CompressionMemory settings>

!age 7

March "#$ 1997

Microsoft MakeCAB Users G ide

Piecemea& %%+s for ,oca&i'atio$ a$d %iffere$t %isk Si'es


MA.6CAB.676 'as designed to %ini%i?e the a%o nt of d plicate infor%ation needed to generate prod ct layo ts for different lang ages and disk si?es. A key feat re is the a&ility to specify %ore than one 99@ on the MA.6CAB.676 co%%and line. @or e-a%ple) ac%e.ddf lang.ddf disk.ddf prod ct.ddf =o%e standard definitions to control the for%at of the o tp t 0A@ file =ets lang age5specific settings :=o rce9ir$ for e-a%ple* =ets the diskette si?es :C93<M$ 1."M$ 1.BBM$ etc.* 1ists all the files in the prod ct$ and ses varia&les set in the previo s 99@s to c sto%i?e its operation

8he follo'ing co%%and line 'o ld &e sed to process this set of 99@s)
MakeCAB <f acme.))f <f la +.))f <f )i"k.))f <f pr!)(ct.))f

MakeCAB Co$cepts
8he key feat re of MakeCAB is that it takes a set of files and prod ces a disk la$out 'hile at the sa%e ti%e atte%pting to %ini%i?e the n %&er of disks re( ired. 0n order to nderstand ho' MakeCAB does this$ three ter%s need to &e defined) cabinet$ folder$ and file. MakeCAB takes all of the files in the prod ct or application &eing co%pressed$ lays the &ytes do'n as one contin o s &yte strea%$ co%presses the entire strea%$ chopping it p into folders as appropriate$ and then fills p one or %ore cabinets 'ith the folders. Cabinet A nor%al file that contains pieces of one or %ore files$ s ally co%pressed. Also kno'n as a NCAB fileO. A deco%pression &o ndary. 1arge folders ena&le higher co%pression$ &eca se the co%pressor can refer &ack to %ore data in finding patterns. 2o'ever$ to retrieve a file at the end of a folder$ the entire folder % st &e deco%pressed. =o there is a tradeoff &et'een achieved co%pression and the ( ickness of rando% access to individ al files. A file to &e placed in the layo t..

%older

%ile

%ecoup&i$g +i&e ,a-out a$d ./+ ,a-out


MakeCAB has t'o N%odesO for generating the 0A@ file; unified mode and relational mode. 0n unified mode$ the 0A@ file is generated as file copy co%%ands are processed in the 99@ file. 8his is the defa lt$ and %ini%i?es the a%o nt of effort needed to constr ct a 99@ file. 2o'ever$ this forces the 0A@ file to list the files in the layo t in e-actly the sa%e order as they are placed on disksCca&inets. "#ample of a $nified DDF:
;** %et (p IN7 f!rmat" #ef!re 8e )! t.e )i"k la$!(t/ #eca("e MakeCAB ; 8rite" Di"k a ) Ca#i et i f!rmati! !(t a" it i" +e erate). .OPTION EXPLICIT ; Ge erate err!r" f!r ( )efi e) varia#le" .%et I fDi"kHea)er'-I)i"k li"tJ.%et I fDi"kHea)er&'-;9)i"k (m#er:/9)i"k la#el:.%et I fDi"kLi e7!rmat'-*)i"kK*/*la#el*.%et I fCa#i etHea)er'-Ica#i et li"tJ.%et I fCa#i etHea)er&'-;9ca#i et (m#er:/9)i"k (m#er:/9ca#i et file .%et I fCa#i etLi e7!rmat'-*ca#K*/*)i"kK*/*ca#file*.%et I f7ileHea)er'-;*** 7ile Li"t ***ame:-

!age H

March "#$ 1997

Microsoft MakeCAB Users G ide


.%et .%et .%et .%et I I I I f7ileHea)er&'-;9)i"k (m#er:/9ca#i et (m#er:/9file ame:/9"i0e:f7ileHea)er*'-;N!teE 7ile i" !t i a ca#i et if ca#K i" >f7ileHea)er,'-f7ileLi e7!rmat'-*)i"kK*/*ca#K*/*file*/*)ate*/*"i0e*; 6 ifie) m!)e 3 create t.e IN7 file a" 8e +!

."et Ge erateI f'ON ;** ; ; ;

%et(p file". T.e"e )! Lt ee) t! #e i t.e IN7 file/ "! 8e p(t <i f'NO ! t.e"e li e" "! t.at MakeCAB 8! Lt +e erate a err!r 8.e it fi )" t.at t.e"e file" are !t me ti! e) i t.e IN7 p!rti! !f t.e DD7.

."et C!mpre""'O77 ."et Ca#i et'O77 "et(p.exe <i f'NO "et(p.i f <i f'NO ;** 7ile" i ca#i et" ."et C!mpre""'ON ."et Ca#i et'ON ;* P(t all #itmap" t!+et.er a&.#mp #&.#mp c&.#mp )&.#mp a*.#mp #*.#mp c*.#mp )*.#mp ".are).)ll <)ate'&><&*<M, clie t&.exe clie t*.exe ;*** T.e E )

; T.i" file )!e" Lt ".!8 (p i ; T.i" file )!e" Lt ".!8 (p i

IN7 IN7

t! .elp c!mpre""i! ; Bitmap f!r clie t&.exe ; Bitmap f!r clie t&.exe ; Bitmap f!r clie t&.exe ; Bitmap f!r clie t&.exe ; Bitmap f!r clie t&.exe ; Bitmap f!r clie t*.exe ; Bitmap f!r clie t*.exe ; Bitmap f!r clie t*.exe ; 7ile ee)e) #$ clie t&.exe a ) clie t*.exe ; ee)" ".are).)ll ; ee)" ".are).)ll

0n relational mode the 99@ has file reference lines to specify the e-act place%ent of file infor%ation lines$ incl ding the a&ility to list the sa%e file % ltiple ti%es. 8his feat re is i%portant for 0A@ str ct res 'hich se section headers :e.g. NFclipartGO$ NFscreen saversGO* to identify sets of files for partic lar f nctionality$ and for 'hich the sa%e file %ay need to &e incl ded in %ore than one section. @or e-a%ple$ a prod ct %ay have several optional feat res$ all of 'hich re( ire a 911 file na%ed Nshared.dllO. 3ather than having Nshared.dllO stored % ltiple ti%es :once for each section 'hich ses the file*$ a 'aste of disk space$ a single copy of the file can &e stored$ and then referenced &y all of the sections 'hich re( ire it. A relational %ode 99@ is si%ilar to a nified %ode 99@$ 'ith the e-ception that a N.set Generate0nfJ<@@O line % st &e inserted &efore the prod cts files are listed :as sho'n &elo'*. <nce all of the files have &een listed$ the 0A@ file generating portion of the 99@ &egins$ and a N.set Generate0nfJ<AO line % st &e inserted$ follo'ed &y the section definitions. "#ample of a %elational DDF:
;** %et (p IN7 f!rmat" #ef!re 8e )! t.e )i"k la$!(t/ #eca("e MakeCAB ; 8rite" Di"k a ) Ca#i et i f!rmati! !(t a" it i" +e erate). .OPTION EXPLICIT ; Ge erate err!r" f!r ( )efi e) varia#le" .%et I fDi"kHea)er'-I)i"k li"tJ.%et I fDi"kHea)er&'-;9)i"k (m#er:/9)i"k la#el:.%et I fDi"kLi e7!rmat'-*)i"kK*/*la#el*-

!age 9

March "#$ 1997

Microsoft MakeCAB Users G ide

.%et I fCa#i etHea)er'-Ica#i et li"tJ.%et I fCa#i etHea)er&'-;9ca#i et (m#er:/9)i"k (m#er:/9ca#i et file .%et I fCa#i etLi e7!rmat'-*ca#K*/*)i"kK*/*ca#file*.%et .%et .%et .%et .%et I I I I I f7ileHea)er'-;*** 7ile Li"t ***f7ileHea)er&'-;9)i"k (m#er:/9ca#i et (m#er:/9file ame:/9"i0e:f7ileHea)er*'-;N!teE 7ile i" !t i a ca#i et if ca#K i" >f7ileHea)er,'-f7ileLi e7!rmat'-*)i"kK*/*ca#K*/*file*/*)ate*/*"i0e*-

ame:-

; ; *** Here i" 8.ere 8e li"t all t.e file" ; ."et Ge erateI f'O77 ; =ELATIONAL MODE 3 D! )i"k la$!(t fir"t ;** ; ; ; %et(p file". T.e"e )! Lt ee) t! #e i t.e IN7 file/ "! 8e p(t <i f'NO ! t.e"e li e" "! t.at MakeCAB 8! Lt +e erate a err!r 8.e it fi )" t.at t.e"e file" are !t me ti! e) i t.e IN7 p!rti! !f t.e DD7.

."et C!mpre""'O77 ."et Ca#i et'O77 "et(p.exe <i f'NO "et(p.i f <i f'NO ;** 7ile" i ca#i et" ; ."et C!mpre""'ON ."et Ca#i et'ON ;* P(t all #itmap" t!+et.er a&.#mp #&.#mp c&.#mp )&.#mp a*.#mp #*.#mp c*.#mp )*.#mp ".are).)ll <)ate'&><&*<M, clie t&.exe clie t*.exe

; T.i" file )!e" Lt ".!8 (p i ; T.i" file )!e" Lt ".!8 (p i

IN7 IN7

t! .elp c!mpre""i! ; Bitmap f!r clie t&.exe ; Bitmap f!r clie t&.exe ; Bitmap f!r clie t&.exe ; Bitmap f!r clie t&.exe ; Bitmap f!r clie t&.exe ; Bitmap f!r clie t*.exe ; Bitmap f!r clie t*.exe ; Bitmap f!r clie t*.exe ; 7ile ee)e) #$ clie t&.exe a ) clie t*.exe ; ee)" ".are).)ll ; ee)" ".are).)ll

; ; *** N!8 8e;re +e erati + t.e IN7 file ; ."et Ge erateI f'ON ;** 7eat(re O e file" .I fBe+i 7ile Ifeat(re O eJ ;7ile" f!r feat(re ! e .I fE ) clie t&.exe ".are).)ll <)ate'>1<>&<M1 a&.#mp #&.#mp c&.#mp )&.#mp

; Overri)e )ate

!age 1#

March "#$ 1997

Microsoft MakeCAB Users G ide


;** 7eat(re T8! file" .I fBe+i 7ile Ifeat(re T8!J ;7ile" f!r feat(re T8! ;N!te t.at ".are).)ll i" al"! reN(ire) #$ 7eat(re O e .I fE ) clie t&.exe ".are).)ll a*.#mp #*.#mp c*.#mp )*.#mp ;*** T.e E )

The generated &'F file (ould look something like this:


I)i"k li"tJ ;9)i"k (m#er:/9)i"k la#el: &/-Di"k &Ica#i et li"tJ ;9ca#i et (m#er:/9)i"k &/&/ca#i et.& (m#er:/9ca#i et file ame:

;*** 7ile Li"t *** ;9)i"k (m#er:/9ca#i et (m#er:/9file ame:/9"i0e: ;N!teE 7ile i" !t i a ca#i et if ca#K i" > Ifeat(re O eJ ;7ile" f!r feat(re ! e &/&/clie t&.exe/&*<&*<M,/&*,1 &/&/".are).)ll/>1<>&<M1/&*,1 &/&/a&.#mp/&*<&*<M,/2O, &/&/#&.#mp/&*<&*<M,/2O, &/&/c&.#mp/&*<&*<M,/2O, &/&/)&.#mp/&*<&*<M,/2O, Ifeat(re T8!J ;7ile" f!r feat(re T8! ;N!te t.at ".are).)ll i" al"! reN(ire) #$ 7eat(re O e &/&/clie t&.exe/&*<&*<M,/&*,1 &/&/".are).)ll/&><&*<M,/&*,1 &/&/a*.#mp/&*<&*<M,/P1, &/&/#*.#mp/&*<&*<M,/P1, &/&/c*.#mp/&*<&*<M,/P1, &/&/)*.#mp/&*<&*<M,/P1,

Aotes) :1* 0n PrelationalP %ode$ only the last setting of a partic lar &nf7-- defa lt para%eter varia&le :&oth standard para%eters like &nfDate$ &nfTime$ etc. and c sto% para%eters* in the layo t portion :i.e. the first part* of the 99@ is respected. "#ample: 0f yo did P.set &nfDateJ1"C#DC9"P at the start of the layo t portion$ and then did P.set &nfDateJ#1C#1C9BP in the %iddle of the layo t portion$ the latter val e 'o ld &e sed for the entire 0A@ file. :"* Any para%eters on a reference line 'ill override para%eters on the corresponding file copy line. "#ample:
;* la$!(t p!rti! #ar <x'& ...

!age 11

March "#$ 1997

Microsoft MakeCAB Users G ide


;* IN7 p!rti! #ar <x'*

; IN7 file 8ill .ave val(e *

:+* 0n PrelationalP %ode$ each file copy co%%and in the layo t portion of the 99@ % st &e referenced at least once in a reference co%%and in the 0A@ portion of the 99@. Any files that are not referenced 'ill ca se an error d ring pass 1. 8he )infJno para%eter % st &e specified on any file copy co%%ands for files 'hich are going to &e o%itted fro% the 0A@ file :s ch as =68U!.676 and =68U!.0A@*. :B* 0n PrelationalP %ode$ $ni*ueFiles % st &e +'$ &eca se the destination file na%e is sed in the 0A@ portion of the 99@ to refer &ack to file infor%ation.

MA01CAB)121
MA.6CAB.676 is designed to prod ce the final distri& tion files and ca&inets for an entire prod ct in a single r n. 8he %ost co%%on 'ay to se MA.6CAB.676 is to s pply a directives file that controls ho' files are co%pressed and stored into one or %ore ca&inets.

MA01CAB)121 S-$ta3
8here t'o pri%ary for%s of MA.6CAB.676 sage. 8he first is sed for co%pressing a single file$ 'hile the second is sed for co%pressing % ltiple files. MAKECAB MAKECAB I/V J I/D varia#le'val(e ...J I/L )irect!r$J "!(rce I)e"ti ati! J I/V J I/D varia#le'val(e J /F )irective"Qfile I...J

the para%eters are descri&ed &elo' Parameter source destination Description A file to &e co%pressed. 8he na%e of the file to receive the co%pressed version of the so rce file. 0f not s pplied$ a defa lt destination na%e is constr cted fro% the so rce file na%e according to the r les defined &y the CompressedFile"#tensionChar varia&le on page "+. Qo can se C9 Co%pressed@ile6-tensionCharJc on the co%%and line to change the appended character. =et variable to &e e( al to value. 6( ivalent to sing the ,Set co%%and in the directives file. @or e-a%ple$ a single directive file co ld &e sed to prod ce layo ts for different disk si?es &y r nning MakeCAB once 'ith different val es of Ma#DiskSi!e defined) C9 Ma-9isk=i?eJ1.BBM. Both standard MakeCAB varia&les and c sto% varia&les %ay &e defined in this 'ay. 0f ,+ption "#plicit is specified in a directive file$ then variable % st &e defined 'ith a ,Define co%%and in a directive file. =pecifies an o tp t directory 'here the co%pressed file 'ill &e placed :%ost sef l 'hen destination is not s pplied*.

)D variableJvalue

)- director$

!age 1"

March "#$ 1997

Microsoft MakeCAB Users G ide

)F directivesRfile

).n

A file containing co%%ands for MA.6CAB.676 to e-ec te. 0f %ore than one directive file is specified :C@ file1 C@ file" ...*$ they are processed in the order :left to right* specified on the co%%and line. Laria&le settings$ open ca&inets$ open disks$ etc. are all carried for'ard fro% one directive file to the ne-t :S st as if all of the files had &een concatenated together and presented as a single file to MakeCAB*. @or e-a%ple$ this is intended to si%plify the 'ork for a prod ct shipped in % ltiple lang ages. 8here 'o ld &e a short$ lang age5specific directives file$ and then a single$ large %aster directives file that covers the & lk of the prod ct. =et de& gging ver&osity level :#Jnone$...$+Jf ll*

MA01CAB)121 %irective +i&e S-$ta3


Before diving into the details of the synta- of the directives file$ provided here is an e-a%ple of 'hat the 6-cel directives file %ight look like)
;*** ; .%et .%et .%et .%et .%et EXCEL MA@ECAB Directive file Di"kLa#el&'%et(p Di"kLa#el*'Pr!+ram Di"kLa#el,'-Pr!+ram C! ti (e)Ca#i etNameTemplate'EXCEL*.CAB MaxDi"k%i0e'&.11M ; ; ; ; ; La#el !f fir"t )i"k La#el !f "ec! ) )i"k La#el !f t.ir) )i"k EXCEL&.CAB/ EXCEL*.CAB/ etc. ,.2- )i"k"

;** %et(p.exe a ) "et(p.i f are place) ( c!mpre""e) i t.e fir"t )i"k .%et Ca#i et'!ff .%et C!mpre""'!ff #i 4"et(p.exe ; 5("t c!p$ %ET6P.EXE a" i" #i 4"et(p.i f ; 5("t c!p$ %ET6P.IN7 a" i" ;** T.e re"t !f t.e file" are "t!re)/ c!mpre""e)/ i ca#i et file" .%et Ca#i et'! .%et C!mpre""'! #i 4excel.exe ; Bi+ EXE/ 8ill "pa ca#i et" #i 4excel..lp #i 4!lecli.)ll #i 4!le"rv.)ll ...

2ere are so%e additional notes on the general synta- and &ehavior of MakeCAB 9irective @iles 1#* MakeCAB 'ill place files on disks :and in ca&inets* in the order they are specified in the directive file:s*. 11* ,hen ever a filena%e or directory is called for$ yo %ay s pply either a relative :e.g.$ fooT&ar$ ..Tfoo* or an a&sol te :e.g.$ c)T&anana$ -)Tsl%TsrcT&in* path. 1"* <pti%al co%pression is achieved 'hen files 'ith si%ilar types of data are gro ped together. 1+* MakeCAB is controlled in large part &y setting variables. MakeCAB has %any predefined varia&les$ all of 'hich have defa lt val es chosen to represent the %ost co%%on case. Qo can %odify these varia&les$ and yo can define yo r o'n varia&les as 'ell. 1B* 8he val e of a varia&le is retrieved &y enclosing the varia&le na%e in percent :U* signs. 0f the varia&le is not defined$ an error is generated. 0f yo 'ant an e-plicit percent sign$ se t'o adSacent percent signs :UU*. MakeCAB 'ill collapse this to a single percent sign :U*. 1D* Laria&le s &stit tion is only done once. @or e-a%ple$ .=et AJ<ne FA is N<neOG; .=et BJUUAUU :B is NUA UO*; .=et CJUBU :C is NUAUO$ not N<neO*. 1E* Laria&le s &stit tion is done &efore any other line parsing$ so varia&les can &e sed any'here. 17* Laria&les val es %ay incl de &lanks. V ote :N* or apostrophe:W* %arks %ay &e sed in .=et state%ents to capt re &lanks. 0f yo 'ant an e-plicit ( ote:N* or apostrophe:W*$ yo can inter%i- these t'o %arks : se one for

!age 1+

March "#$ 1997

Microsoft MakeCAB Users G ide &racketing so that yo %ay specify the other*$ or$ as 'ith the percent sign a&ove$ yo can specify t'o adSacent %arks :NO* and MakeCAB 'ill collapse this to a single %ark:N*. 1H* All si?es are specified in &ytes. 19* 8here are a fe' special val es for co%%on disks si?es :C93<M$ 1.BBM$ 1."M$ 7"#.$ +E#.* that can &e sed for any of the predefined MakeCAB varia&les that descri&e the attri& tes of a disk :Ma#DiskSi!e$ ClusterSi!e$ Ma#DiskFileCount*. MakeCAB has & ilt5in kno'ledge a&o t the correct val es of these attri& tes for these co%%on disk si?es. "#* MakeCAB does not check for H.+ filena%e li%itations directly$ & t rather depends pon the nderlying operating syste% to do filena%e validity checking :this 'ill allo' MakeCAB to 'ork 'ith long file na%es.* "1* MakeCAB %akes t'o passes of the directive file:s*. <n the first pass$ MakeCAB checks for synta- errors and %akes s re that all of the files can &e fo nd. 8his is very fast$ and red ces the chance that the second pass$ 'here the act al data co%pression occ rs$ 'ill have any pro&le%s. 8his is i%portant &eca se co%pression is very ti%e cons %ing$ so MakeCAB 'ants to avoid$ for e-a%ple$ spending an ho r co%pressing files only to find that a file to'ard the end of the directive file:s* cannot &e fo nd.

Command Summary
8he follo'ing ta&le provides a s %%ary of the MakeCAB 9irective @ile synta-. 9irectives &egin 'ith a period :N.O*$ follo'ed &y a co%%and na%e$ and possi&ly &y &lank deli%ited arg %ents. Aote that a @ile Copy co%%and is disting ished fro% a @ile 3eference co%%and &y the setting of the /enerate&nf varia&le. =ynta9escription 0 Co%%ent :any'here on a 99@ line* src FdestG F)infJyesXnoG F)uni*ueJyesXnoG @ile Copy co%%and FC-Jy ...G dest FC-Jy ...G @ile 3eference co%%and ,Define varia&leJFval eG 9efine variable to &e e( al to value :see ,+ption "#plicit* ,Delete varia&le 9elete a varia&le definition ,Dump 9isplay all varia&le definitions ,&nfBegin Disk X Cabinet 1 Folder Copy lines to specified 0A@ file section ,&nf"nd 6nd an ,&nfBegin section ,&nf2rite string ,rite NstringO to file section of 0A@ file ,&nf2riteCabinet string ,rite NstringO to ca&inet section of 0A@ file ,&nf2riteDisk string ,rite NstringO to disk section of 0A@ file ,'e( Disk X Cabinet 1 Folder =tart a ne' 9isk$ Ca&inet$ or @older ,+ption "#plicit 3e( ire ,Define first ti%e for ser5defined varia&les ,Set varia&le3Fval eG =et variable to &e e( al to value Uvaria&leU = &stit te val e of variable &blank line' Blank lines are ignored

.ariable Summary
=tandard Laria&les CabinetJ+' X +FF CabinetFileCountThresholdJco nt Cabinet'amenJfilena%e Cabinet'ameTemplateJte%plate Checksum2idthJ4 X 5 X ... X 6 ClusterSi!e3&ytes!erCl ster CompressJ+' X +FF CompressedFile"#tensionCharJchar CompressionTypeJMS7&P DestinationDir3path DiskDirectorynJdirectory DiskDirectoryTemplateJte%plate 9escription 8 rns Ca&inet Mode on or off 8hreshold co nt of files per Ca&inet Ca&inet file na%e for ca&inet n %&er n Ca&inet file na%e te%plate; Y is replaced &y Ca&inet n %&er Ma- lo'5order he- digits displayed &y 0A@ csum para%eter Cl ster si?e on diskette :defa lt is D1" &ytes* 8 rns co%pression on or off 1ast character of the file e-tension for co%pressed files Co%pression engine 9efa lt path for destination files :stored in ca&inet file* < tp t directory na%e for disk n < tp t directory na%e te%plate; Y is replaced &y disk n %&er

!age 1B

March "#$ 1997

Microsoft MakeCAB Users G ide Disk-abelnJla&el Disk-abelTemplateJte%plate Do'otCopyFilesJ +' X +FF FolderFileCountThresholdJco nt FolderSi!eThresholdJsi?e /enerate&nfJ+' X +FF &nf(xxJstring &nfCabinet8eaderFnGJstring &nfCabinet-ineFormatFnGJfor%at string &nfCommentStringJstring &nfDateFormatJyyyy9mm9dd X mm)dd)yy &nfDisk8eaderFnGJstring &nfDisk-ineFormatFnGJfor%at string &nfFile8eaderFnGJstring &nfFile-ineFormatFnGJfor%at string &nfFile'ameJfilena%e &nfFooterFnGJstring &nf8eaderFnGJstring &nfSection+rderJFD X C X FGY Ma#CabinetSi!eJsi?e Ma#DiskFileCountJco nt Ma#DiskSi!eFnGJsi?e Ma#"rrorsJco nt %eser ePerCabinetSi!eJsi?e %eser ePerDataBlockSi!eJsi?e %eser ePerFolderSi!eJsi?e %ptFile'ameJfilena%e SourceDirJpath $ni*ueFilesJ+' 1 +FF !rinted disk la&el na%e for disk n !rinted disk la&el na%e te%plate; Y is replaced &y disk n %&er Controls 'hether files are act ally copied :ACM6 A9M0A.0A@* 8hreshold co nt of files per @older 8hreshold folder si?e for c rrent folder Control Unified vs. 3elation 0A@ generation %ode =et defa lt val e for 0A@ !ara%eter 7-0A@ ca&inet section header te-t 0A@ ca&inet section detail line for%at 0A@ co%%ent string 0A@ date for%at 0A@ disk section header te-t 0A@ disk section detail line for%at 0A@ file section header te-t 0A@ file section detail line for%at Aa%e of 0A@ file 0A@ footer te-t 0A@ header te-t 0A@ section order :disk$ ca&inet$ file* Ma-i% % ca&inet file si?e for c rrent ca&inet Ma-i% % co nt of files per 9isk Ma-i% % disk si?e Ma-i% % errors allo'ed &efore pass 1 ter%inates Base a%o nt of space to reserve for @C36=63L6 data A%o nt of space to reserve in each data &lock A%o nt of additional space in @C36=63L6 for each folder Aa%e of 3!8 file 9efa lt path for so rce files Control 'hether d plicate desintation file na%es are allo'ed

&nfDisk)Cabinet)File-ineFormat Synta# and Semantics


8he &nfDisk-ineFormat$ &nfCabinet-ineFormat$ and &nfFile-ineFormat varia&les are sed to control the for%atting of the NdetailO lines in the 0A@ file. 8he synta- of the val es assigned to these varia&les is as follo's) 1* 8he NYO character is sed to &racket replacea&le para%eters. "* 8'o NYO characters in a ro' :NYYO* are replaced &y a single NYO. +* A replacea&le para%eter na%e %ay &e one of the standard ones defined &y MakeCAB$ or it %ay &e a c sto% para%eter. 8he val e sed for a para%eter is fo nd in the follo'ing order) ""* 0f a para%eter is specified on a @ile Copy or @ile 3eference co%%and$ the specified val e is sed. "+* 0f a varia&le 0nf7--- is defined for this para%eter$ its val e is sed. "B* 8he para%eter is a standard para%ater$ and its defined val e is sed. B* Braces PZ[P %ay &e sed to indicate portions of te-t pl s e-actly one para%eter that are o%itted if the para%eter val e is &lank. @or e-a%ple$ NZYidY$[YfileY$Ysi?eYO 'ill generate the follo'ing strings$ depending pon the val es of id$ file$ and si?e) id file foo.da t foo.da t si?e "+ "+ "+ < tp t =tring foo.dat$"+ 17$foo.dat$"+ 17$$"+

17 17

!age 1D

March "#$ 1997

Microsoft MakeCAB Users G ide

&'F Parameters
8he follo'ing ta&le lists the standard para%eters that %ay &e specified in 0A@ line for%ats and on @ile Copy and @ile 3eference co%%ands. 8he 9isk$ Ca&$ and @ile col %ns indicate 'hich para%eters are s pported in the &nfDisk-ineFormat$ &nfCabinet-ineFormat$ and &nfFile-ineFormat$ respectively. 0n addition$ the @ile col %n also indicates 'hich para%eters %ay &e specified on the @ile Copy and @ile 3eference co%%ands. !ara%ete r attr cab: cabfile csum date disk: file file: label lang si!e time er ers 9isk Ca& Qes Qes Qes Qes @ile Qes Qes Qes Qes Qes Qes Qes 9escription @ile attri& tes :AJarchive$ 3Jread5only$ 2Jhidden$ =Jsyste%* Ca&inet n %&er :# %eans not in ca&inet$ 1 or higher is ca&inet n %&er* Ca&inet file na%e Checks % @ile date :%%CddCyy or yyyy5%%5dd$ depending pon &nfDateFormat* 9isk n %&er :15&ased* 9estination file na%e in layo t :in ca&inet or on a disk* 9estination file n %&er in layo t :first file is 1$ second file is "$ ...*; the order of @ile Copy Co%%ands controls the file n %&er$ so in relational 0A@ %ode the order of @ile 3eference Co%%ands has no affect on the file n %&er. 9isk ser5reada&le la&el :val e co%es fro% Disk-abeln$ if defined$ and other'ise is constr cted fro% Disk-abelTemplate*. 1ang age :i.e.$ L63.911 info* in &ase 1#$ &lank separated if % ltiple val es @ile si?e :only affects val e 'ritten to 0A@ file* @ile ti%e :hh)%%)ssFaXpG* Binary @ile version :n.n.n.n &ase 1# for%at* =tring @ile version 55 can &e different fro% er>

Qes Qes Qes Qes Qes Qes

4 st as c sto% 0A@ para%eters can &e defined &y sing the ,Define and ,Set co%%and :e.g.$ ,Set 0nfC sto%Jdefa lt val e*$ the ,Set co%%and can also &e sed to override the val es of these para%eters. 8his is %ost o&vio sly sef l for the date and time para%eters$ as it provides a si%ple 'ay to Ndate sta%pO all the files in a layo t; and for the attr para%eter$ this provides a 'ay to force a consistent set of file attri& tes :co%%only sed to clear the read5only and archive attri& te &its*.

Command Details
0 A co%%ent line. A co%%ent %ay appear any'here in a directive file. 0n addition$ any line %ay incl de a co%%ent at the end. Any te-t on the line follo'ing the co%%ent is ignored. so rce FdestinationG F)&'FJ ;"S X '+G F)$'&<$"J;"S X '+G F)#Jy F)#Jy ...GG A @ile Copy Co%%and; specifies a file to &e placed onto a disk or ca&inet. 0f /enerate&nf is +FF$ then lines 'itho t leading periods are interpreted as @ile Copy Co%%ands. source is a file na%e$ and %ay incl de a relative or a&sol te path specification. 8he SourceDir varia&le is applied first$ if specified. destination is the na%e to store in the ca&inet file :if Cabinet is +n*$ or the na%e for the destination file :if Cabinet is +ff*. 8he DestinationDir varia&le is sed as a prefi-. )&'FJ;"S X '+ controls 'hether destination % st specified in a 3eference co%%and in the 0A@ section of the 99@. 0f ;"S is specified :the defa lt*$ then destination % st &e specified in at least one 3eference co%%and. 0f '+ is specified$ then destination does not have to &e specified in any 3eference co%%and. 8his para%ter is sed only if 3elational 0A@ %ode is selected :see the /enerate&nf varia&le*$ as Unified %ode does not s pport 3eference co%%ands.

!age 1E

March "#$ 1997

Microsoft MakeCAB Users G ide

)$'&<$"J;"S X '+ controls 'hether destination % st &e ni( e thro gho t the layo t. =pecifiying this para%eter on the file copy co%%and overrides the defa lt setting controlled &y the $ni*ueFiles varia&le :'hich defa lts to Q6=*. 0f 3elational 0A@ %ode is selected :see the /enerate&nf varia&le*$ then $ni*ueFiles % st &e ;"S. )#Jy per%its standard and c sto% 0A@ para%eters to &e applied to a file copy co%%and. 8hese para%eters are carried along 'ith the file &y MakeCAB and sed to for%at file detail lines in the 0A@ file. 0n addition$ the )Date$ )Time$ and )Attr para%eters also control the val es that are placed in the ca&inet files or on the disk layo t :for files o tside of a ca&inet*. 8his per%its a great deal of fle-i&ility in c sto%i?ing the 0A@ file for%at. A para%eter N-O is defined to have the val e NyO :'hich %ay &e e%pty*. V otes can &e sed in NyO to incl de &lanks or other special characters. 0f a para%eter N-O is also defined on a @ile 3eference co%%and$ that setting overrides any setting for N-O specified on the referred to @ile Copy co%%and. =ee N0A@ !ara%etersO on page 6rror) 3eference so rce not fo nd for a list of standard para%eters. '+T": ;ou must define a ariable &nf= if you are going to use )=3y on a File Copy >or File %eference? command, 0f no s ch varia&le is defined$ then C7Jy 'ill generate an error. 8his &ehavior ens res that there is a defa lt val e for every para%eter$ and %akes it easier to catch inadvertent typing errors. 0f the destination is not specified$ its defa lt val e depends pon the Cabinet and Compress varia&les$ as indicated &y the follo'ing ta&le$ sing B0AT67C61.676 as a sa%ple so rce file na%e. Aote that the varia&le CompressedFile"#tensionChar controls the act al character sed to indicate a co%pressed file. Aote also that the DestinationDir varia&le is prefi-ed to the destination na%e &efore it is stored in the ca&inet file. Compress 3 +FF
1

Compress 3 +' 67C61.67R 55 co%pressed$ not in ca&inet :act ally$ this is a ca&inet 'ith a single file>* 67C61.676 55 co%pressed$ in a ca&inet

Cabinet 3 +FF

Cabinet 3 +'

67C61.676 55 nco%pressed$ not in a ca&inet. 67C61.676 55 nco%pressed$ in a ca&inet. ; ; ; ; ; ; ; ; ; ; ;

6-a%ples) .%et C!mpre""'O77 .%et Ca#i et'O77 "et(p.exe <i f' ! "et(p.i f .%et C!mpre""'ON rea)me.txt .%et Ca#i et'ON #i 4excel.exe m")ra8.exe m"app"4m")ra8.exe a.txt )(p.txt <( iN(e' ! #.txt )(p.txt <( iN(e' !

T(r !ff c!mpre""i! N! ca#i et file %et(p i" p(t ! )i"k &/ 8! ;t #e i Cla""ic c.icke F t.e e++ pr!#lem

IN7

T(r c!mpre""i! ! Place) ! )i"k & a" =EADME.TXQ T(r ca#i et file creati! ! Place) i ca#i et a" EXCEL.EXE Place) i ca#i et a" M%APP%4M%D=AR.EXE A !t.er )(p.txt i" all!8e) A ) .ere it i"

destination F)#Jy F)#Jy ...GG A @ile 3eference Co%%and; specifies that infor%ation for a file :previo sly specified in a @ile Copy co%%and* is to &e 'ritten to the @ile section of the 0A@ file. 8his co%%and is only s pported in 3elational 0A@ %ode. 0f /enerate&nf is +'$ then lines 'itho t leading periods are interpreted as @ile 3eference Co%%ands.

1 Co%pressing a single file is generally not a good idea$ as &etter co%pression is achieved &y co%pressing across file &o ndaries :hence ca&inet files*. 2o'ever$ MakeCAB s pports this in case clients sed to the old 'ay of 'riting a set p progra% need this feat re. 0nstead of having t'o different file for%ats$ tho gh$ 'e si%ple create a ca&inet that has S st the one file in it. !age 17 March "#$ 1997

Microsoft MakeCAB Users G ide destination is the na%e of a file previo sly specified in a @ile Copy co%%and as the destination in the layo t :not the so rce>*. 8herefore$ $ni*ueFiles is re( ired to &e +'. )#Jy per%its standard and c sto% 0A@ para%eters to &e applied to a file reference co%%and. 8hese para%eters are %erged 'ith any para%eters specified on the referenced @ile Copy co%%and$ 'ith para%eters on the @ile 3eference co%%and taking precedence. A para%eter N-O is defined to have the val e NyO :'hich %ay &e e%pty*. V otes can &e sed in NyO to incl de &lanks or other special characters. . =ee N0A@ !ara%etersO on page 6rror) 3eference so rce not fo nd for a list of standard para%eters. '+T": ;ou must define a ariable &nf= if you are going to use )=3y on a File %eference >or File Copy? command, 0f no s ch varia&le is defined$ then C7Jy 'ill generate an error. 8his &ehavior ens res that there is a defa lt val e for every para%eter$ and %akes it easier to catch inadvertent typing errors. 6-a%ples) .%et Ge erateI f'O77 "et(p.exe <i f' ! rea)me.txt ".are).)ll <"pecial'$e" .%et Ge erateI f'ON .I fRrite IC!mm! J rea)me.txt .I fRrite IO eJ ".are).)ll <"pecial' ! .I fRrite IT8!J ".are).)ll ,Define varia&le3Fval eG 9efine variable to &e e( al to value. 8o se variable$ s rro nd it 'ith percent signs :U* 55 Uvaria&leU. Using an ndefined varia&le is an error$ and 'ill ca se MakeCAB to stop &efore pass ". value %ay incl de references to other varia&les. 1eading and trailing &lanks in value are discarded. Blanks %ay &e enclose in ( ote :N* or apostrophe :W* %arks. 6-plicit percent signs :U*$ ( otes :N*$ or apostrophes :W* % st &e specified t'ice. '+T": 0f ,+ption "#plicit is specified$ then yo % st first se ,Define to define any ser5defined varia&les &efore yo can se ,Set to %odify the%. @or standard MakeCAB varia&les$ ,Define is not per%itted$ and only ,Set %ay &e sed on. 0f ,+ption "#plicit is not specified$ then ,Define is e( ivalent to ,Set. e e e e e e e e e e la +'ENGLI%H c!( tr$'6%A %!(rceDir'Sla +S4Sc!( tr$S T!i 'Sla +SSc!( tr$S "(cce""'&>>SS %!(rceDir' c! tracti! 'U)! ;tV c! tracti! ')! ;;t "!me%pace"' .i t.ere "!meM!re'U #l(e )!+ U ; ; ; ; ; ; ; ; ; ; %et la +(a+e %et c!( tr$ %!(rceDir ' IENGLI%H46%AJ T!i ' IENGLI%H6%AJ "(cce"" ' I&>>SJ %!(rceDir ' IJ c! tracti! ' I)! ;tJ c! tracti! ' I)! ;tJ "!me%pace" ' I.i t.ereJ "!meM!re ' I #l(e )!+ J

; =elati! al IN7 m!)e; file la$!(t ; %et(p i" p(t ! )i"k &/ 8! ;t #e i ; C("t!m parameter ; IN7 "ecti! !f DD7

IN7

; Overri)e parm !

file c!p$ c!mma )

; 6"e <"pecial val(e fr!m file c!p$

6-a%ples .Defi .Defi .Defi .Defi .Defi .Defi .Defi .Defi .Defi .Defi

!age 1H

March "#$ 1997

Microsoft MakeCAB Users G ide ,Delete varia&le 9elete a varia&le definition. Qo %ay only delete varia&les that have &een created &y ,Define or ,Set co%%ands. =tandard MakeCAB varia&les %ay not &e deleted. 6-a%ples) .%et m$Waria#le'rai"i .Delete m$Waria#le ,Dump 9isplay the entire MakeCAB varia&le ta&le. 8his co%%and can &e sed to aid de& gging of co%plicated :or not so co%plicated* MakeCAB directive files. Aote that the d %p 'ill &e displayed d ring pass 1 and again d ring pass ". 6-a%ples) .D(mp ; D(mp varia#le ta#le t! "t)!(t

; Delete m$Waria#le

,&nfBegin D&S@ 1 CAB&'"T 1 F&-" =tart a &lock of one or %ore lines to 'rite to the specified area of the 0A@ file. 8he lines in the &lock 'ill &e copied n%odified to the specified section of the 0A@ file$ so no MakeCAB varia&le s &stit tion 'ill &e perfor%ed. =i%ilarly$ MakeCAB 'ill not strip co%%ents. Use ,&nf2rite$ ,&nf2riteCabinet$ or ,&nf2riteDisk if yo need varia&le s &stit tion. 6-a%ples) .I fBe+i )i"k ; Text f!r )i"k "ecti! !f IN7 file ;T.i" i" a c!mme t f!r t.e )i"k "ecti! . MakeCAB 8ill !t pr!ce"" ;t.i" li e/ "!/ f!r example/ SvarS 8ill !t #e "(#"tit(te). .I fE ) ,&nf"nd 8er%inate an .0nfBegin &lock. 6-a%ples) .I fE ) ,&nf2rite string ,rite string to the file area of the 0A@ file. Aote that lines 'ill have MakeCAB co%%ents re%oved and varia&le val es s &stit ted. 0f yo 'ant to avoid this processing$ se the ,&nfBegin File co%%and. 1eading 'hitespace is nor%ally re%oved$ & t yo can override this &y placing 'hitespace in ( otes :see e-a%ples &elo'* 6-a%ples) .I fRrite IA %ecti! Hea)erJ ; Text f!r file "ecti! / t.i" c!mme t ; 8ill !t appear. ; MakeCAB "trip" !ff t.e c!mme t"/ "! t.i" ; c!mma ) T("t 8rite" a #la k li eG ; Get t.at c!mme t i t.e IN7 file ; Cl!"e a .I fBe+i #l!ck

.I fRrite ;9)i"k:/9file: .I fRrite U;9)i"k:/9file:U

!age 19

March "#$ 1997

Microsoft MakeCAB Users G ide .I fRrite U US"!meWarS ; Get lea)i + "pace ! t.e IN7 li e

,&nf2riteCabinet string ,rite string to the ca&inet area of the 0A@ file. Aote that lines 'ill have MakeCAB co%%ents re%oved and varia&le val es s &stit ted. 0f yo 'ant to avoid this processing$ se the ,&nfBegin Cabinet co%%and. 6-a%ples) .I fRriteCa#i et 1>SS !ff $!(r fav!rite f(r it(re ; SS c!llap"e )!8 t! ; ! e S/ #eca("e MakeCAB )!e" varia#le ; "(#"tit(ti! ! t.e "tri +. ,&nf2riteDisk string ,rite string to the disk area of the 0A@ file. Aote that lines 'ill have MakeCAB co%%ents re%oved and varia&le val es s &stit ted. 0f yo 'ant to avoid this processing$ se the ,&nfBegin Disk co%%and. 6-a%ples) .I fRriteDi"k T.e =ai ,'e( Disk X Cabinet 1 Folder @orce a disk$ ca&inet$ or folder &reak. 8his is sed to co%plete the c rrent disk$ ca&inet$ or folder$ and start a ne' one. 6-a%ples) .Ne8 Di"k .Ne8 Ca#i et .Ne8 7!l)er ,Set varia&le3val e =et variable to &e e( al to value. 8o se variable$ s rro nd it 'ith percent signs :U* 55 Uvaria&leU. Using an ndefined varia&le is an error$ and 'ill ca se MakeCAB to stop &efore pass ". value %ay incl de references to other varia&les. value %ay &e e%pty$ in 'hich case variable is set to the e%pty string. 1eading and trailing &lanks in value are discarded. Blanks %ay &e enclose in ( ote :N* or apostrophe :W* %arks. 6-plicit percent signs :U*$ ( otes :N*$ or apostrophes :W* % st &e specified t'ice. '+T": 0f ,+ption "#plicit is specified$ then yo % st first se ,Define to define any ser5defined varia&les &efore yo can se ,Set to %odify the%. @or standard MakeCAB varia&les$ ,Define is not per%itted$ and only ,Set %ay &e sed on. la +'ENGLI%H c!( tr$'6%A %!(rceDir'Sla +S4Sc!( tr$S T!i 'Sla +SSc!( tr$S "(cce""'&>>SS %!(rceDir' c! tracti! 'U)! ;tV ; ; ; ; ; ; ; %et la +(a+e %et c!( tr$ %!(rceDir ' IENGLI%H46%AJ T!i ' IENGLI%H6%AJ "(cce"" ' I&>>SJ %!(rceDir ' IJ c! tracti! ' I)! ;tJ ; %tart a ; %tart a ; %tart a e8 )i"k e8 ca#i et e8 f!l)er i %pai fall" Mai l$ ! t.e Plai

6-a%ples .%et .%et .%et .%et .%et .%et .%et

!age "#

March "#$ 1997

Microsoft MakeCAB Users G ide .%et c! tracti! ')! ;;t .%et "!me%pace"' .i t.ere .%et "!meM!re'U #l(e )!+ U ; c! tracti! ' I)! ;tJ ; "!me%pace" ' I.i t.ereJ ; "!meM!re ' I #l(e )!+ J

.ariable Details
8he standard MakeCAB varia&les are listed &elo'. 8hese varia&les are predefined$ and each of the% have defa lt val e$ 'hich is sed if yo do not set the varia&le fro% the co%%and line :C9 varJval e* or prior to the ti%e yo e-plicitly set the varia&le 'ith a ,Define or ,Set co%%and in a directive file. Qo can create yo r o'n varia&les as 'ell$ sing the ,Define co%%and if yo specify ,+ption "#plict$ and the ,Set co%%and other'ise. CabinetJ+n X +ff 8 rns cabinet mode on or off. 9efa lt) .=et Ca&inetJ<n

; Ca&inet %ode is <A

,hen ca&inet %ode is +n$ the follo'ing applies) 1* @iles are stored in a ca&inet$ 'hose na%e is taken fro% the Cabinet'ameTemplate varia&le "* 0f the co%pressed si?e of a file 'o ld ca se the c rrent Ca&inet to e-ceed the c rrent Ma#CabinetSi!e varia&le$ then as % ch of the co%pressed file as possi&le is stored in the c rrent Ca&inet$ that Ca&inet is closed$ and a ne' Ca&inet is created. Aote that it is possi&le for a large file to span % ltiple Ca&inets> +* 0f the co%pressed si?e of a file :or set of files$ if the files are s%all* 'o ld ca se the c rrent @older to e-ceed the c rrent MinFolderSi!e varia&le$ these files are the last ones added to the c rrent @older$ a ne' @older is started for any s &se( ent files." Aote that if the c rrent @older cannot fit in the c rrent Ca&inet$ as % ch as possi&le of the @older is stored in the c rrent Ca&inet$ and the re%ainder of the @older is stored in the ne-t Ca&inet. 8his %eans that it is possi&le for several files to &e contin ed fro% one Ca&inet file to the ne-t Ca&inet file> ,hen ca&inet %ode is +ff$ the follo'ing applies) 1* @iles are stored in individ al files "* 0f the destination file is not s pplied$ the defa lt na%e is controlled &y the compression mode :see the Compress varia&le* 6-a%ples .%et Ca#i et'O77 .%et C!mpre""'O77 "et(p.exe .%et Ca#i et'ON .%ET C!mpre""'ON ; ; ; ; ; 7ile" !t i ca#i et"... ...a ) ! c!mpre""i! . %et(p pr!+ram i" "impl$ c!pie) t! )i"k. 6"e a ca#i et... ...a ) c!mpre"" remai i + file".

CabinetFileCountThresholdJco nt =ets a goal for the %a-i% % n %&er of files in a ca&inet. 9efa lt) .=et Ca&inet@ileCo nt8hresholdJ# ; 9efa lt is no threshold count is a threshold for the n %&er of files to store in a ca&inet. <nce this co nt has &een reached$ MakeCAB 'ill close the c rrent ca&inet as soon as possi&le. 9 e to the &locking of files for co%pression p rposes$ it is possi&le that the ca&inet 'ill contain %ore files than specified &y this varia&le. 0f count is #$ then there is no li%it on the n %&er files per ca&inet. 6-a%ples) " 8he %otivation here is that a @older is a deco%pression &o ndary$ and so is advisory. 8o access a file in a @older$ yo % st start deco%pressing fro% the &eginning of a @older$ potentially deco%pressing :and discarding* %any files ntil yo arrive at the desired file. 0f 'e %ade the c rrent folder larger$ then this file S st added 'o ld take longer to access. 0n general$ the MinFolderSi!e varia&le sho ld &e several ti%es larger than +".$ to &e of any tility. !age "1 March "#$ 1997

Microsoft MakeCAB Users G ide .%et Ca#i et7ileC!( tT.re".!l)'&>> ; %.!!t f!r &>> file" per ca#i et

Cabinet'amenJfilena%e 8he ca&inet file na%e for the specified ca&inet. 9efa lt) ; By defa lt none of these varia&les are defined 0f this varia&le is not defined for a partic lar disk$ then MakeCAB ses the Cabinet'ameTemplate to constr ct the ca&inet na%e. 6-a%ples) .%et Ca#i etName&'! e.ca# Cabinet'ameTemplateJte%plate =ets the ca&inet file na%e te%plate. 9efa lt) .=et Ca&inetAa%e8e%plateJY.CAB; 1.CAB$ ".CAB$ ... 8his te%plate is sed to constr ct the file na%e of each ca&inet. 8he PYP in this te%plate is replaced &y the ca&inet n %&er :1$ "$ etc.*. 8his varia&le is sed only if no varia&le Cabinet'amen e-ists for ca&inet n. '+T": Be sure that the e#panded cabinet name does not e#ceed the limits for your file systemA @or e-a%ple$ if yo sed NCAB0A68Y.CABO$ and MakeCAB had to create 1# or %ore ca&inets$ then yo 'o ld have ca&inet na%es like CAB0A681#.CAB$ 'hich is 9.+$ 'hich is an invalid na%e in the @A8 file syste%. Unfort nately$ MakeCAB 'o ld not detect this ntil it had already created 9 ca&inets> 6-a%ples) .%et Ca#i etNameTemplate'EXCEL*.DIA ; EXCEL&.DIA/ EXCEL*.DIA/ etc. .%et Ca#i etNameTemplate'*. ; &/ */ ,/ etc. Checksum2idthJ4 X 5 X ... X 6 =ets the %a-i% % n %&er of lo'5order he- digits displayed &y &nfFile-ineFormat csum para%eter. 9efa lt) .=et Checks %,idthJH ; 9efa lt is all H he- digits :cs % is a +"5&it val e* 8he presence of the csum para%eter in the &nfFile-ineFormat varia&le ca ses MakeCAB to co%p te a +"5&it C3C for each file and 'rite that checks % to the 0A@ file. ,hile leading ?eros are not 'ritten o t$ the presence of these checks %s can significantly increase the si?e of the 0A@ file. Qo can se Checksum2idth to restrict the si?e of the checks % 'ritten to the 0A@ file. 0f a val e less than H is specified$ then MakeCAB 'ill %ask off the high5order &its of the +"5&it checks % to prod ce a val e for the 0A@ file that is at %ost the n %&er of he- digits specified. 6-a%ples) .%et C.eck"(mRi)t.'1 ; O l$ )i"pla$ t.e l!8 !r)er 1 .ex )i+it"

ClusterSi!eJ&ytes!erCl ster 8he cl ster si?e of the distri& tion %edia. 9efa lt) .=et Cl ster=i?eJD1" ; 1.BBM and 1."M floppies have D1"5&yte cl sters 8his is sed &y MakeCAB to ro nd p the si?es of files and ca&inets to a cl ster &o ndary$ so it can deter%ine 'hen to s'itch to the ne-t disk. Qo can se a standard disk si?e fro% the follo'ing list$ and MakeCAB 'ill s pply the kno'n cl ster si?e for that disk si?e) 4,BBM 4,5CM :4apanese A6C +.DO drive capacity*

!age ""

March "#$ 1997

Microsoft MakeCAB Users G ide 4,5M D5E@ FGE@ CD%+M 6-a%ples) .%et Cl("ter%i0e'&.11M CompressJ+' X +FF 8 rn file co%pression on or off. 9efa lt) .=et Co%pressJ<n ; 6"e k !8 &.11M fl!pp$ i f!

; Co%pression is on

,hile co%pression is s ally on$ yo generally t rn if off for the first fe' files on disk 1 :=68U!.676$ for e-a%ple*. 8his applies regardless of the Cabinet setting$ so it is valid to store one or %ore nco%pressed files in a Ca&inet @ile. 6-a%ples) .%et Ca#i et'O77 .%et C!mpre""'O77 "et(p.exe .%et Ca#i et'ON .%ET C!mpre""'ON ; ; ; ; ; 7ile" !t i ca#i et"... ...a ) ! c!mpre""i! . %et(p pr!+ram i" "impl$ c!pie) t! )i"k. 6"e a ca#i et... ...a ) c!mpre"" remai i + file".

CompressedFile"#tensionCharJchar 1ast character in file na%e sed 'hen co%pressing an individ al file. 9efa lt) .=et Co%pressed@ile6-tensionCharJR ; 9efa lt is an nderscore :PRP* 0f CabinetJ+FF and CompressJ+' $ then MakeCAB 'ill co%press an individ al file. ,hile the co%pressed files is stored in a Ca&inet @ile$ it has only a single file. 8o %aintain so%e consistency 'ith e-isting set p co%pression prod cts$ the defa lt co%pressed file na%e is constr cted &y taking the so rce file na%e and replacing the last character of the file e-tension 'ith the setting of this varia&le. 6-a%ples) .%et C!mpre""e)7ileExte "i! C.ar'X ; ; ; ; ; %AMPLE.EXE %AMPLE.EX %AMPLE.E %AMPLE. %AMPLE ': ': ': ': ': %AMPLE.EXX %AMPLE.EXX %AMPLE.EX %AMPLE.X %AMPLE.X

CompressionTypeJMS7&P =elect co%pression engine. 9efa lt) .=et Co%pression8ypeJM=/0!

; 9efa lt is M=/0! co%pressor

M=/0! is the defa lt co%pression type s pported &y Microsoft. 8his version of MakeCAB.676 also s pports the 1/7 co%pression %ethod$ 'hich can achieve higher co%pressions ratios. Using M=/0! co%pression and @older=i?e8hresholdJ1 'ill generate a ca&inet file appro-i%ately the sa%e si?e as a !./0!5co%pati&le co%pression engine. 1/7 co%pression re( ires %ore ti%e$ & t 1/7 deco%pression is typically faster. 6-a%ples) .%et C!mpre""i! T$pe'M%AIP ; M%AIP c!mpre""!r

DestinationDirJpath !ath prefi- to store in ca&inet file for each file in the ca&inet.

!age "+

March "#$ 1997

Microsoft MakeCAB Users G ide 9efa lt) .=et 9estination9irJ ; 9efa lt is no path prefi-

path is concatenated 'ith a path separator :NTO* and the target file na%e on @ile Copy Co%%ands to prod ce the file na%e that is stored in ca&inet file. 6783AC8.676 'ill se this file na%e as the defa lt na%e 'hen the file is e-tracted. 6-a%ples) .%et De"ti ati! Dir'%Y%TEM #i 4A=IAL.TT7 .%et De"ti ati! Dir' #i 4A=IAL.TT7 ; ; ; ; 7!ll!8i + file" +et %Y%TEM prefix Name i ca#i et i" %Y%TEM4A=IAL.TT7 N! prefix Name i ca#i et i" A=IAL.TT7

DiskDirectorynJdirectory 8he o tp t directory na%e for the specified disk. 9efa lt) ; By defa lt none of these varia&les are defined 0f this varia&le is not defined for a partic lar disk$ then MakeCAB ses the DiskDirectoryTemplate to constr ct the disk directory. 6-a%ples) .%et Di"kDirect!r$&')i"k.! e DiskDirectoryTemplateJte%plate =et the o tp t directory na%e te%plate. <ne directory is created for each disk of the layo t. 9efa lt) .=et 9isk9irectory8e%plateJ90=.Y ; 9efa lt is 90=.1$ 90=."$ etc. As MakeCAB processes a directive file$ it 'ill create one or %ore disk Ni%agesO. 3ather than sing so%e specific disk for%at$ ho'ever$ MakeCAB si%ply creates one s &directory for each disk and places the files for each disk in the appropriate directory. 0f a NYO e-ists in this varia&le$ then it is replaced 'ith the disk n %&er. 0f no NYO is specified$ then all files are placed in the single directory specified &y this varia&le. 8his varia&le is sed only if no varia&le DiskDirectoryn e-ists for disk n. 6-a%ples) .%et Di"kDirect!r$Template'CE4EXCELP4DI%@* ; P(t file" i "eparate )ir" .%et Di"kDirect!r$Template'CE4EXCELP ; P(t all file" i CE4EXCELP .%et Di"kDirect!r$Template' ; P(t all file" i c(rre t )ir Disk-abelnJla&el 8he ser5reada&le te-t string for the specified disk. 9efa lt) ; By defa lt none of these varia&les are defined 8his label is stored in ca&inet files that contain files that are split across disk &o ndaries$ to si%plify pro%pting for the appropriate disk to insert into the drive. @or e-a%ple$ if 67C61.676 started in 1.CAB and finished in ".CAB$ and a ser asked to e-tract 67C61.676 fro% ".CAB$ 6783AC8.676 can retrieve the printed la&el for the disk containing 1.CAB :say$ 6-cel !rogra% 9isk 1* and tell the ser to insert that disk and try again. 0f this varia&le is not defined for a partic lar disk$ then MakeCAB ses the Disk-abelTemplate to constr ct the disk la&el. 6-a%ples) .%et Di"kLa#el&'VExcel %et(p Di"k &V .%et Di"kLa#el*'VExcel %et(p Di"k *V Disk-abelTemplateJte%plate

!age "B

March "#$ 1997

Microsoft MakeCAB Users G ide =et the printed disk la&el. Used if individ al Disk-abeln varia&les are not defined 9efa lt) .=et 9isk1a&el8e%plateJN9isk YO ; 9efa lt is N9isk 1O$ N9isk "O$ etc. =ets the defa lt ser5reada&le disk la&el. 0f a NYO e-ists in this varia&le$ then it is replaced 'ith the disk n %&er. 8his varia&le is sed only if no varia&le Disk-abeln e-ists for disk n. 6-a%ples) .%et Di"kLa#elTemplate'UExcel Di"k *V Do'otCopyFilesJ+n X +ff Controls 'hether @ile Copy Co%%ands act ally copy files. 9efa lt) .=et 9oAotCopy@ilesJ<ff ; @iles are copied 8his option is intended to &e sed 'hen Ca&inet is <@@ and Co%press is <@@$ as a %eans of generating an 0A@ file very ( ickly. 0t has no affect 'hen Ca&inet is <A or Co%press is <A. 6-a%ples .%et D!N!tC!p$7ile"'ON ; Make MakeCAB create t.e IN7 file N(ickl$

FolderFileCountThresholdJco nt =et the threshold on the n %&er of files to store in a folder. 9efa lt) .=et @older@ileCo nt8hresholdJ# ; 9efa lt to no li%it on co nt of files in a folder =ets the threshold file co nt for the c rrent folder. ,hen this threshold is e-ceeded$ then the c rrent folder is closed. 0f any %ore files are to &e processed$ they 'ill go into a ne' folder. 0f Cabinet is +FF$ this varia&le is ignored. 0f count is #$ then there is no li%it on the co nt of files in a folder. 6-a%ples) .%et 7!l)er7ileC!( tT.re".!l)'2> ; N! m!re t.a 2> file" per f!l)er

FolderSi!eThresholdJsi?e =et the threshold si?e for the c rrent folder. 9efa lt) .=et MinMa-@older=i?eJ# ; 9efa lt to the %a-i% % ca&inet si?e =ets the threshold si?e for the c rrent folder. ,hen this threshold is e-ceeded$ then the c rrent folder is closed. 0f any %ore files are to &e processed$ they 'ill go into a ne' folder. MakeCAB atte%pts to li%it folders to the si?e specified &y this varia&le$ & t in %ost cases folders 'ill &e a &it larger than this threshold. 0f Cabinet is +FF$ this varia&le is ignored. 0f si)e is #$ then the threshold is the sa%e as the %a-i% % ca&inet si?e. @olders are co%pressionCencryption &o ndaries. 8he state of the co%pressor and cryptosyste% are reset at folder &o ndaries. 8o access a file in a folder$ the folder % st &e decrypted and deco%pressed starting fro% the front of the folder and contin ing thro gh to the desired file. 8h s$ s%aller folder thresholds are appropriate for a layo t 'here a s%all n %&er of files needs to &e rando%ly accessed ( ickly fro% a ca&inet. <n the other hand$ larger folder thresholds per%it the co%pressor to e-a%ine %ore data$ and so generally yield &etter co%pression res lts. @or a layo t 'here the files 'ill &e accessed se( entially and %ost of the files 'ill &e accessed$ a larger folder threshold is &est. 6-a%ples) .%et 7!l)er%i0eT.re".!l)'&M ; Aim f!r &M# f!l)er"

!age "D

March "#$ 1997

Microsoft MakeCAB Users G ide /enerate&nf3+' 1 +FF Controls Unified vs. 3elational 0A@ generation %ode. 9efa lt) .=et Generate0nfJ<A ; 9efa lt to P nifiedP 0A@ %ode 0f /enerate&nf is +' 'hen the first file copy co%%and is enco ntered$ then Unified 0A@ %ode is selected. 0n this %ode$ file detail lines are 'ritten to the 0A@ file as file copy co%%ands are processed$ so the order of file lines in the 0A@ is e-actly the sa%e as the order of the files in the layo t. 0f /enerate&nf is +FF 'hen the first file copy co%%and is enco ntered$ then 3elational 0A@ %ode is selected. 0n this %ode$ file copy co%%ands are processed$ & t 0A@ file generation is delayed ntil /enerate&nf is set to +'$ and @ile 3eference co%%ands are sed to select infor%ation on files in the layo t to &e placed in the 0A@ file. *nified mode is easier to se$ since each file is specifed only once$ and is %ost appropriate for ( ick sage of MakeCAB. +elational mode is %ore co%plicated$ since each file % st &e specified :at least* t'ice$ & t it provides very fine control of &oth the disk layo t and the for%at of the 0A@ file. 0n partic lar$ so%e 0A@ files 'ant to have sections to list the files associated 'ith a certain feat re$ there %ay &e %any s ch sections$ and so%e files %ay &e re( ired in %ore than one section. Unified %ode does not provide any %ethod to generate s ch an 0A@ file$ & t 3elational %ode does via the @ile 3eference co%%and. By separating the disk layo t order fro% the 0A@ file order$ MakeCAB per%its opti%i?ation of the file layo t for co%pression vs. access ti%e. 8he la$out section of the 99@ contains file copy co%%ands that control precisely 'here files are in the layo t. 8he ,-% section of the 99@ contains 0A@ for%atting infor%ation$ incl ding @ile 3eference co%%ands to p ll in infor%ation a&o t specific files fro% earlier @ile Copy co%%ands in the layo t section. Aotes) :1* <nce /enerate&nf is set to +' and at least one @ile Copy co%%and has &een processed$ /enerate&nf %ay not &e set to +FF :i.e.$ in 3elational Mode$ all @ile Copy co%%ands % st &e processed &efore any @ile 3eference co%%ands* 6-a%ples) ;** La$!(t "ecti! 3 7ile C!p$ c!mma )" .%et Ge erateI f'O77 f!!.exe #ar.exe !t.er.exe f!!.exe f!!&.exe .... ;** IN7 "ecti! 33 7ile =efere ce c!mma )" .%et Ge erateI f'ON .RriteI f -Ia "ecti! Jf!!.exe !t.er.exe f!!&.exe <re ame'"$"4f!!.exe ; pa"" c("t!m parameter .... &nf(xxJstring =ets the defa lt val e for an 0A@ para%eter. 9efa lt) FAot applica&leG Laria&les of this for% :other than the standard ones in this list* can &e sed for t'o p rposes) "D* 8o override the s al val e of a standard 0A@ para%eter :like date$ time$ attr$ etc.* for all the files :or a set of files* in the layo t. !age "E March "#$ 1997

Microsoft MakeCAB Users G ide "E* 8o define a c sto% 0A@ para%eter$ and specify its defa lt val e. Aotes) :1* ,hen in 3elation 0A@ %ode$ only the last alue for a partic lar &nf(xx varia&le 'ill &e carried over fro% the layo t section to the 0A@ section of the 99@. 0n the follo'ing e-a%ple) ;** La$!(t "ecti! 3 7ile C!p$ c!mma )" .%et Ge erateI f'O77 ; %elect =elati! al IN7 .%et I fC("t!m'apple file.& .%et I fC("t!m'pear file.* ;** IN7 "ecti! 3 7ile =efere ce c!mma )" .%et Ge erateI f'ON file.& ; *c("t!m* val(e i" UpearV/ !t UappleVG file.* 6-a%ples) .%et .%et .%et .%et I I I I fDate'>2<>*<M1 fTime'>PE>>E>>a fAttr' fC("t!m'$e" ; ; ; ; Date Time T(r Defi "tamp all file" "tamp all file" !ff all attri#(te" Ce"p. rea)3! l$D e c("t!m IN7 parameter

&nfCabinet8eaderFnGJstring =ets the header te-t for the ca&inet section of the 0A@ file. 9efa lt) .=et 0nfCa&inet2eaderJPFca&inet listGP 8his string is 'ritten to the 0A@ prior to any ca&inet detail lines. MakeCAB 'ill also se any varia&les of the for% &nfCabinet8eadern 'here n is an integer 'ith no leading ?eros :#*. 8hese additional lines 'ill &e printed o t in increasing order after the &nfCabinet8eader line. Any ,&nfBegin CabinetC,&nf"nd lines 'ill &e printed as they are enco ntered$ & t in any event after all of these header lines. 6-a%ples) .%et I fCa#i etHea)er'U;L!t" !; ca#i et"V .%et I fCa#i etHea)er' ; N! ca#i et .ea)er

.%et I fCa#i etHea)er'U;Li e & !f ca#i et"V .%et I fCa#i etHea)er&'U;Li e * !f ca#i et"V .%et I fCa#i etHea)er*'U;Li e , !f ca#i et"V &nfCabinet-ineFormatFnGJfor%at string =ets the detail line for%at for the ca&inet section of the 0A@ file. 9efa lt) .=et 0nfCa&inet1ine@or%atJYca&\Y$Ydisk\Y$Yca&fileY 8his for%at is sed to generate a line in the Pca&inetP section of the 0A@. 0f a n %eric s ffi- n is specified in the varia&le na%e$ then the specified for%at is sed for ca&inet n %&er n. 0f no s ch ca&inet n %&er5specific for%at is defined$ then the val e of the &nfCabinet-ineFormat varia&le is sed. =ee N0nf9iskCCa&inetC@ile1ine@or%at =ynta- and =e%anticsO on page 1D for details on the for%at string.. =ee N0A@ !ara%etersO on page 1E for a list of the allo'ed para%eter na%es. &nfCommentStringJstring =ets the line co%%ent string for the 0A@ file. 9efa lt) .=et 0nfCo%%ent=tringJP;P

!age "7

March "#$ 1997

Microsoft MakeCAB Users G ide 8his is the string MakeCAB 'ill se to prefi- co%%ent lines that it generates in the 0A@ :the a togenerated MakeCAB versionCdateCti%e lines$ for e-a%ple*. &nfDateFormatJQQQQ5MM599 X MMC99CQQ =ets the date for%at sed for dates 'ritten to the 0A@ file. 9efa lt) .=et 0nf9ate@or%atJMMC99CQQ ; 9efa lt to nor%al U= convention 8his for%at is sed to for%at the date para%eter for the &nfFile-ineFormat sed to 'rite file detail lines to the 0A@ file. 6-a%ples) .%et I fDate7!rmat'YYYY3MM3DD &nfDisk8eaderFnGJstring =ets the header te-t for the disk section of the 0A@ file. 9efa lt) .=et 0nf9isk2eaderJPFdisk listGP 8his string is 'ritten to the 0A@ prior to any disk detail lines. MakeCAB 'ill also se any varia&les of the for% &nfDisk8eadern 'here n is an integer 'ith no leading ?eros :#*. 8hese additional lines 'ill &e printed o t in increasing order after the &nfDisk8eader line. Any ,&nfBegin DiskC,&nf"nd lines 'ill &e printed as they are enco ntered$ & t in any event after all of these header lines. 6-a%ples) .%et I fDi"kHea)er'U;L!t" !; Di"k"V .%et I fDi"kHea)er' ; N! Di"k .ea)er ; 6"e t.e preferre) ACME f!rmat

.%et I fDi"kHea)er'U;Li e & !f Di"k"V .%et I fDi"kHea)er&'U;Li e * !f Di"k"V .%et I fDi"kHea)er*'U;Li e , !f Di"k"V &nfDisk-ineFormatFnGJfor%at string =ets the detail line for%at for the disk section of the 0A@ file. 9efa lt) .=et 0nf9isk1ine@or%atJYdisk\Y$Yla&elY 8his for%at is sed to generate a line in the PdisksP section of the 0A@. 0f a n %eric s ffi- n is specified in the varia&le na%e$ then the specified for%at is sed for disk n %&er n. 0f no s ch disk n %&er5specific for%at is defined$ then the val e of the &nfDisk-ineFormat varia&le is sed. =ee N0nf9iskCCa&inetC@ile1ine@or%at =ynta- and =e%anticsO on page 1D for details on the for%at string.. =ee N0A@ !ara%etersO on page 1E for a list of the allo'ed para%eter na%es. &nfFile8eaderFnGJstring =ets the header te-t for the file section of the 0A@ file. 9efa lt) .=et 0nf@ile2eaderJPFfile listGP 8his string is 'ritten to the 0A@ prior to any file detail lines. MakeCAB 'ill also se any varia&les of the for% &nfFile8eadern 'here n is an integer 'ith no leading ?eros :#*. 8hese additional lines 'ill &e printed o t in increasing order after the &nfFile8eader line. Any ,&nfBegin FileC,&nf"nd lines 'ill &e printed as they are enco ntered$ & t in any event after all of these header lines. &nfFile-ineFormatFnGJfor%at string =ets the detail line for%at for the file section of the 0A@ file. 9efa lt) .=et 0nf@ile1ine@or%atJYdisk\Y$Yca&\Y$YfileY$Ysi?eY

!age "H

March "#$ 1997

Microsoft MakeCAB Users G ide 8his for%at is sed to generate a line in the PfileP section of the 0A@. 0f a n %eric s ffi- n is specified in the varia&le na%e$ then the specified for%at is sed for file n %&er n :file n %&ers start at 1$ and are &ased on the @ile Copy Co%%ands$ not the @ile 3eference Co%%ands*. 0f no s ch file n %&er5specific for%at is defined$ then the val e of the &nfFile-ineFormat varia&le is sed. =ee N0nf9iskCCa&inetC@ile1ine@or%at =ynta- and =e%anticsO on page 1D for details on the for%at string.. =ee N0A@ !ara%etersO on page 1E for a list of the allo'ed para%eter na%es. &nfFile'ameJfilena%e =ets the na%e of the 0A@ o tp t file. 9efa lt) .=et 0nf@ileAa%eJ=68U!.0A@

; 9efa lt file na%e is =68U!.0A@

9efines the file na%e for the 0A@ file. 8his file has disk$ ca&inet$ and file infor%ation that is intended for se &y a set p progra% d ring the set p process. 6-a%ples) .%et I f7ileName'EXCEL.IN7 &nfFooterFnGJstring =ets the footer te-t for &eginning of the 0A@ file. 9efa lt) CC 3 n MakeCAB and se the .9 %p co%%and to see the defa lt footer 8hese strings are 'ritten to the 0A@ file after all other infor%ation. 8o disa&le this footer te-t$ set 0nf@ooter to the e%pty string :.=et 0nf@ooterJ*. MakeCAB 'ill also se any varia&les of the for% &nfFootern 'here n is an integer 'ith no leading ?eros :#*. 8hese additional lines 'ill &e printed o t in increasing order after the &nfFooter line$ starting 'ith &nfFooter4. 8he follo'ing special strings %ay &e specified in 0nf@ooterFnG val es :note that the t'o percent signs are re( ired$ so that MakeCAB does not interpret these as varia&le references*) =tring UU1 UU" UU+ 6-a%ples) .%et .%et .%et .%et .%et .%et I I I I I I 9escription 8he co%%ent string 55 each 0nf@ooterFnG line sho ld pro&a&ly start 'ith U U1. 8he date and ti%e MakeCAB 'as r n to prod ce the 0A@ file. 8he version of MakeCAB se to prod ce the 0A@ file. f7!!ter' f7!!ter'USS& S* S,V f7!!ter'USS&*****V f7!!ter&'USS&* S*V f7!!ter*'USS&* S,V f7!!ter,'USS&*****V ; ; ; ; ; ; Di"a#le IN7 f!!ter text %.!rt f!!ter L! + f!!ter L! + f!!ter c! ti (e) L! + f!!ter c! ti (e) L! + f!!ter c! ti (e)

&nf8eaderFnGJstring =ets the header te-t for &eginning of the 0A@ file. 9efa lt) CC 3 n MakeCAB and se the .9 %p co%%and to see the defa lt header. 8hese strings are 'ritten to the 0A@ file prior to any other infor%ation. 8o disa&le this header te-t$ set 0nf2eader to the e%pty string :.=et 0nf2eaderJ*. MakeCAB 'ill also se any varia&les of the for% &nf8eadern 'here n is an integer 'ith no leading ?eros :#*. 8hese additional lines 'ill &e printed o t in increasing order after the &nf8eader line$ starting 'ith &nf8eader4. 8he follo'ing special strings %ay &e specified in 0nf2eaderFnG val es :note that the t'o percent signs are re( ired$ so that MakeCAB does not interpret these as varia&le references*) =tring UU1 9escription 8he co%%ent string 55 each 0nf2eaderFnG line sho ld pro&a&ly start 'ith U

!age "9

March "#$ 1997

Microsoft MakeCAB Users G ide

UU" UU+ 6-a%ples) .%et .%et .%et .%et .%et I I I I I

U1. 8he date and ti%e MakeCAB 'as r n to prod ce the 0A@ file. 8he version of MakeCAB se to prod ce the 0A@ file. fHea)er' fHea)er'USS& S* S,V fHea)er'USS&*****V fHea)er&'USS&* S*V fHea)er*'USS&* S,V ; ; ; ; ; Di"a#le IN7 .ea)er text %.!rt .ea)er L! + .ea)er L! + .ea)er c! ti (e) L! + .ea)er c! ti (e)

,Set &nf8eaderF3HII4JJJJJK 0 -ong header continued&nfSection+rder3LD 1 C 1 FMJ =et the generation and relative order of the 9isk$ Ca&inet$ and @ile sections in the 0A@ file. 9efa lt) .=et 0nf=ection<rderJ9C@ ; 9isk$ then Ca&inet$ and then @ile 8his varia&le controls 'hat sections of the 0A@ file are generated$ and the order in 'hich they appear. 6ach of the letters NCO :ca&inet*$ N9O :disk*$ and N@O :file* %ay &e sed at %ost once. Any or all of these letters %ay &e o%itted$ and the corresponding section of the 0A@ file 'ill not &e generated. 6-a%ples) .%et I f%ecti! Or)er'D7 ; Di"k"/ t.e Ma#CabinetSi!eJsi?e =et the %a-i% % si?e for the c rrent ca&inet. 9efa lt) .=et Ma-Ca&inet=i?eJ# file"/ !mit t.e ca#i et "ecti!

; Ao li%it$ e-cept Ma-9isk=i?e

si)e is the %a-i% % si?e for the c rrent ca&inet. 0f Cabinet is +' 'hen this %a-i% % is e-ceeded$ then the c rrent folder &eing processed 'ill &e split &et'een the c rrent ca&inet and the ne-t ca&inet. 0f Cabinet is +FF$ then this varia&le is ignored. Aote that Ma#DiskSi!e :or Ma#DiskSi!en$ if specified* takes precedence over this varia&le. MakeCAB never splits a ca&inet file across a disk &o ndary$ so a ca&inet file 'ill &e no larger than the a%o nt of free space availa&le on the disk at the ti%e the ca&inet is created$ even if this si?e is less than Ma#CabinetSi!e. 0f si)e is #$ then the ca&inet si?e is li%ited only &y the disk si?e :Ma#DiskSi!e or Ma#DiskSi!en*. 6-a%ples) .%et MaxCa#i et%i0e'> ; 6"e )i"k "i0e a" limit

Ma#DiskFileCountJco nt =ets the %a-i% % n %&er of files that can &e stored on a disk. 9efa lt) .=et Ma-9isk@ileCo ntJ# ; 9efa lt is no li%it count is the %a-i% % n %&er of files to store on a disk. <nce this co nt has &een reached$ MakeCAB 'ill close the c rrent disk$ even if space re%ains on the disk. 8his varia&le is %ost sef l 'hen ca&inet files are not &eing sed :say$ to si% late the old style set p 'here each file is indivd ally co%pressed*$ and MakeCAB needs to nderstand the li%it of the n %&er of files that can &e stored in the root directory of a floppy. 0f count is #$ then there is no li%it on the n %&er files per disk. Qo can se a standard disk si?e fro% the follo'ing list$ and MakeCAB 'ill s pply the kno'n @A8 root directory li%its for that disk si?e) 4,BBM

!age +#

March "#$ 1997

Microsoft MakeCAB Users G ide 4,5CM :4apanese A6C +.DO drive capacity* 4,5M D5E@ FGE@ CD%+M 8he file co nt does not incl de any files inside ca&inets. 6ach ca&inet co nts as a single file for p rposes of this co nt. 6-a%ples) .%et Di"k7ileC!( tMax'*2P .%et Di"k7ileC!( tMax'&.11M Ma#DiskSi!eFnGJsi?e =et the %a-i% % defa lt si?e for a disk. 9efa lt) .=et Ma-9isk=i?eJ1.BBM ; Limit !f *2P file" per )i"k ; 6"e limit f!r &.11M 7AT fl!pp$ )i"k

; 9efa lt is 1.BBM floppy

si)e is the %a-i% % defa lt si?e for a disk. 8his varia&le is sed only for disks for 'hich a varia&le Ma#DiskSi!en is not defined. 0f Cabinet is +FF$ and the ne-t file to &e layed o t cannot fit on the c rrent disk$ then MakeCAB 'ill %ove to the ne-t disk. 0f Cabinet is +'$ then the c rrent ca&inet 'ill se as % ch space on the c rrent disk as possi&le. 0f si)e is #$ then the disk si?e is nli%ited. Qo can se a standard disk si?e fro% the follo'ing list$ and MakeCAB 'ill se the correct disk si?e$ do'n to the &yte) 4,BBM 4,5CM :4apanese A6C +.DO drive capacity* 4,5M D5E@ FGE@ CD%+M 6-a%ples) .%et MaxDi"k%i0e'> .%et MaxDi"k%i0e'CD=OM .%et MaxDi"k%i0e&'O*>@ .%et MaxDi"k%i0e'&.11M ; N! limit ; All file" are #ei + place) ! ; 7ir"t )i"k i" O*>@ ; ... re"t are &.11M

a CD3=OM

Ma#"rrorsJco nt =et the %a-i% % n %&er of errors allo'ed &efore pass 1 ter%inates. 9efa lt) .=et Ma-6rrorsJ"# ; 9efa lt is "# errors count is the %a-i% % n %&er of errors to per%it &efore ter%inating pass 1. 0f count is #$ then an nli%ited n %&er of errors is allo'ed. 6-a%ples) .%et MaxErr!r"'> ; N! limit

!age +1

March "#$ 1997

Microsoft MakeCAB Users G ide .%et MaxErr!r"'2 ; Limit t! T("t a fe8

%eser ePerCabinetSi!eJsi?e =ets a fi-ed si?e to reserve in a ca&inet for the @C36=63L6 str ct re. 9efa lt) .=et 3eserve!erCa&inet=i?eJ# ; 9efa lt is to reserve no space si)e is the a%o nt of space to reserve in a ca&inet for the @C36=63L6 str ct re. 8he total si?e of the @C36=63L6 str ct re is the val e of this varia&le pl s the n %&er of folders in the ca&inet ti%es the val e of the %eser ePerFolderSi!e varia&le. si)e % st &e a % ltiple of B :to ens re %e%ory align%ent on certain syste%s*. A co%%on se for this varia&le is to reserve space to store per5folder cryptosyste% infor%ation$ in the case 'here the ca&inet is encrypted. @or e-a%ple$ so%e sort of checks % val e %ight &e stored here to per%it validation that the key &eing sed to decrypt the ca&inet is act ally the one that 'as sed to encrypt the ca&inet. MakeCAB fills this reserved section 'ith ?eros. 6-a%ples) .%et =e"ervePerCa#i et%i0e'Z ; 7!r ("e a" a cr$pt!"$"tem ke$ c.eck"(m

%eser ePerDataBlockSi!eJsi?e =ets the a%o nt of space to reserve in each 9ata Block header. 9efa lt) .=et 3eserve!er9ataBlock=i?eJ# ; 9efa lt is to reserve no space si)e is the a%o nt of space to reserve in each 9ata Block header. 8his space is located after the standard 9ata Block header and &efore the data for the data &lock. si)e % st &e a % ltiple of B :to ens re %e%ory align%ent on certain syste%s*. <ne possi&le se for this varia&le is to reserve space to store a per5data &lock cryptosyste% infor%ation$ in the case 'here the ca&inet is encrypted.+ MakeCAB fills this reserved section 'ith ?eros. 6-a%ples) .%et =e"ervePerCa#i et%i0e'1 ; =e"erve 1 #$te" per )ata #l!ck

%eser ePerFolderSi!eJsi?e =ets the a%o nt of additional space to reserve in the @C36=63L6 str ct re for each folder in the ca&inet. 9efa lt) .=et 3eserve!er@older=i?eJ# ; 9efa lt is to reserve no space si)e is the a%o nt of space to reserve in the @C36=63L6 str ct re for each folder in the ca&inet. 8he total si?e of the @C36=63L6 str ct re is the val e of this varia&le ti%es the val e of the n %&er of folders in the ca&inet$ pl s the val e of the %eser ePerCabinetSi!e varia&le. si)e % st &e a % ltiple of B :to ens re %e%ory align%ent on certain syste%s*. A co%%on se for this varia&le is to reserve space to store a per5folder cryptosyste% key$ in the case 'here the ca&inet is encrypted. MakeCAB fills this reserved section 'ith ?eros. + FECEC9BG Ali Ba&a is not sing this val e$ so even tho gh it has &een i%ple%ented and tested$ there are no kno'n c sto%ers. !age +" March "#$ 1997

Microsoft MakeCAB Users G ide 6-a%ples) .%et =e"ervePerCa#i et%i0e'Z %ptFile'ameJfilena%e =ets the na%e of the 3!8 o tp t file. 9efa lt) .=et 3pt@ileAa%eJ=68U!.3!8

; %i0e !f a

=C1 cr$pt!"$"tem ke$

; 9efa lt file na%e is =68U!.3!8

9efines the file na%e for the 3!8 file. 8his file has s %%ary infor%ation on the MakeCAB r n. 6-a%ples) .%et =pt7ileName'EXCEL.=PT SourceDirJpath 8he defa lt path sed to locate so rce files specified in @ile Copy Co%%ands. 9efa lt) .=et =o rce9irJ ; 9efa lt is to look in the c rrent directory path is concatenated 'ith a path separator :NTO* and the so rce file na%e on the @ile Copy Co%%and to prod ce the file na%e sed to find the so rce file. 0f path is e%pty$ then the so rce file na%e specified on the @ile Copy Co%%and is not %odified. 6-a%ples) .%et %!(rceDir'CE4P=O5ECT ; 7i ) all "!(rce file" i cE4pr!Tect

$ni*ueFilesJ+' X +FF Controls 'hether destination file na%es in a layo t % st &e ni( e.. 9efa lt) .=et Uni( e@ilesJP<AP ; @ile na%es % st &e ni( e 0f $ni*ueFiles is +'$ MakeCAB checks that all destination file na%es :na%es stored on disks or in ca&inets* are ni( e$ and generates an error :d ring pass 1* if they are not. +' is the defa lt$ since sing the sa%e filena%e t'ice s ally %eans that the sa%e file 'as accidentaly incl ded t'ice$ and this 'o ld &e a 'aste of disk space. 0f $ni*ueFiles is +FF$ MakeCAB per%its d plicate destination file na%es. 8he )$'&<$" para%eter %ay &e specified on individ al @ile Copy co%%ands to override the val e of $ni*ueFiles. 0f the /enerate&nf varia&le is sed to select 3elational 0A@ generation$ then $ni*ueFiles % st al'ays &e +'$ since MakeCAB ses the destination filena%e as the ni( e key to link @ile 3eference co%%ands &ack to @ile Copy co%%ands.

!age ++

March "#$ 1997

Microsoft MakeCAB Users G ide

12(*AC()121
6-tract s pports co%%and5line e-traction of files fro% ca&inet files.

extract I/yJ I/AJ I/D [ /EJ I/L locationJ cabinet_file Ifile_spec ...J extract I/yJ compressed_file Idestination_fileJ ='itches) )A )D )" ));

!rocess all files in a ca&inet set$ starting 'ith the cabinet_file. <nly prod ce a directory listing :do not e-tract*. @orce e-traction. Use the directory specified &y location$ instead of the c rrent directory$ as the defa lt location to place e-tracted files. <ver'rite destination 'itho t pro%pting. 8he defa lt is to pro%pt if the destination file already e-ists$ and allo' the c sto%er to) a* over'rite the file$ &* skip the file$ c* over'rite this file and all s &se( ent files that %ay already e-ist$ or d* e-it.

!ara%eters) compressed.file 8his is a ca&inet file that contains a single file :e-a%ple$ @<<.67R containing @<<.676*. 0f destination.file is not specified$ then the file is e-tracted and given its original na%e in the c rrent directory. destination.file 8his can &e either a relative path :P.)$ P..P$ Pc)fooP$ etc.* or a f lly ( alified path$ and %ay specify either a file :or files$ if 'ild cards are incl ded* or a directory. 0f a directory is specified$ then the file na%e stored in the ca&inet is sed. <ther'ise$ destination.file is sed as the co%plete file na%e for the e-tracted file. cabinet.file 8his is a ca&inet file that contains t'o or %ore files. 0f no file.spec para%eter is specified$ then a list of the files in the ca&inet is displayed. 0f one or %ore file.spec para%eters are specified$ then these are sed to select 'hich files are to &e e-tracted fro% the ca&inet :or ca&inets*. ,ild cards are allo'ed to specify % ltiple ca&inets. location =pecifies the directory 'here e-tracted files sho ld &e placed. file.spec =pecifies files to &e e-tracted fro% the ca&inet:s*. May contain K and Y 'ild cards. M ltiple fileRspecs %ay &e s pplied. 6-a%ples) Command 6783AC8 foo.e-R 6783AC8 foo.e-R &ar.e-e 6783AC8 ca&inet.1 6783AC8 ca&inet.1 Y.e-e Beha ior Ass %ing foo.e-R contained S st the single file foo.e-e$ then foo.e-e 'o ld &e e-tracted and placed in the c rrent directory. Ass %ing foo.e-R contained S st the single file foo.e-e$ then foo.e-e 'o ld &e e-tracted and placed in the c rrent directory in the file &ar.e-e. Ass %ing ca&inet.1 contains % ltiple files$ then a list of the files stored in the ca&inet 'o ld &e displayed. 6-tract all Y.676 files fro% ca&inet.1 and place the% in the c rrent directory

!age +B

March "#$ 1997

También podría gustarte