make cab

Upload: alvaro-completo

Post on 04-Jun-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 Make Cab

    1/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 multiplecabinets or multiple diskettes. Extract can view or retrieve the files which are stored inside cabinet files.

  • 8/13/2019 Make Cab

    2/34

    Microsoft MakeCAB Users Gide

    Table of Contents

    !age " March "#$ 1997

  • 8/13/2019 Make Cab

    3/34

    Microsoft MakeCAB Users Gide

    Overview

    MakeCAB is a lossless data co%pression tool that can &e sed for a 'ide variety of prposes. Althogh it 'asoriginally designed for se &y setp progra%s$ it can also &e sed in al%ost any sitation 'here lossless dataco%pression is re(ired.

    MakeCAB has three key featres) 1* storing %ltiple files in a single cabinet !CAB"# file$ "* perfor%ingco%pression acrossfile &ondaries$ and +* per%itting files to span ca&inets. ,hile e-isting prodcts sch as!/0!$ 2A3C$ and A34$ spport so%e of these featres$ co%&ining all three does not appear to &e co%%onpractice. MakeCAB also spports self5e-tracting archives$ &y si%ply concatenating a ca&inet file to683AC8.66.

    epending 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 &einstrcted to &ild ca&inet files in different 'ays.

  • 8/13/2019 Make Cab

    4/34

    Microsoft MakeCAB Users Gide

    Figure : Distribution disk layout

    Disk 1=68U!.676

    =68U!.0A@

    67C6.1

    Disk 267C6."

    Disk N67C6.A

    =68U!.66 is the setp progra%$ and =68U!.0@ is a file generated &y MakeCAB 'hich gides the operation ofthe setp progra% :'hich files are needed for 'hich options$ and on 'hich disk and in 'hich ca&inet file a file iscontained*. All of the re%aining prodct files are contained in the ca&inet files 6C6.1 throgh 6C6. :%ight &e 7$ for e-a%ple*.

    8o prodce this disk layot 'ith MakeCAB$ a @ is prepared 'hich lists all of the files forthe prodct$ along 'ithso%e optional MakeCAB settings to control para%eters sch 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$ * ho' %ch rando%access is desired for files 'ithin a ca&inet. 8he follo'ing is an e-a%ple of a @ that %ight &e appropriate)

    ;*** MakeCAB Directive file example

    ;.OPTION EXPLICIT ; Geerate err!r" ! varia#le t$p!"

    .%et Di"kLa#el&'%et(p ; La#el !f fir"t )i"k

    .%et Di"kLa#el'Pr!+ram ; La#el !f "ec!) )i"k

    .%et Di"kLa#el,'-Pr!+ram C!ti(e)- ; La#el !f tir) )i"k

    .%et Ca#ietNameTemplate'EXCEL.* ; EXCEL.&/ EXCEL./ etc.

    ."et Di"kDirect!r$Template'Di"k* ; )i"k&/ )i"k/ etc.

    .%et MaxDi"k%i0e'&.11M ; ,.2- )i"k"

    ;** %et(p.exe a) "et(p.if are place) (c!mpre""e) i te fir"t )i"k.%et Ca#iet'!ff.%et C!mpre""'!ff.%et IfAttr' ; T(r !ff rea)3!l$/ etc. attr"#i4"et(p.exe ; 5("t c!p$ %ET6P.EXE a" i"

    #i4"et(p.if ; 5("t c!p$ %ET6P.IN7 a" i"

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

    !age March "#$ 1997

  • 8/13/2019 Make Cab

    5/34

    Microsoft MakeCAB Users Gide

    o'$ yo rn MakeCAB to create the disk layot)MakeCAB >>>> ; Aim f!r ?>>@ per f!l)er.%et C!mpre""i!T$pe'M%IP

    ;** All file" are c!mpre""e) i ca#iet file".%et Ca#iet'!.%et C!mpre""'!f!!.cf!!.....;*** 9te e): ; Tat" it

    Case #: MakeCAB over a $etwork

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

    !age D March "#$ 1997

  • 8/13/2019 Make Cab

    6/34

    Microsoft MakeCAB Users Gide

    683AC8.66$ 'hich e-tracts files fro% CAB files$ recogni?es 'hen it has &een copied to the front of a ca&inetfile$ and 'ill ato%atically e-tract the files in that ca&inet file :and any contination ca&inet files*. 2ere is ho' thisis acco%plished)

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

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

    6-a%ple 1)MakeCAB

  • 8/13/2019 Make Cab

    7/34

    Microsoft MakeCAB Users Gide

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

    MakeCAB introdces the concept of afolder to refer to a contigos set of co%pressed &ytes. 8o deco%press a filefro% a ca&inet$ @0.0B :called &y yor =68U!.66 and 683AC8.66* finds the folder that the file starts in$and then %st read and decompress all the &ytes in that folder fro% the start p throgh and inclding the desiredfile.

    @or e-a%ple$ if the file @

  • 8/13/2019 Make Cab

    8/34

    Microsoft MakeCAB Users Gide

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

    MA6CAB.66 'as designed to %ini%i?e the a%ont of dplicate infor%ation needed to generate prodct layotsfor different langages and disk si?es. A key featre is the a&ility to specify %ore than one @ on theMA6CAB.66 co%%and line. @or e-a%ple)

    ac%e.ddf =o%e standard definitions to control the for%at of the otpt 0@ filelang.ddf =ets langage5specific settings :=orceir$ for e-a%ple*disk.ddf =ets the diskette si?es :C3

  • 8/13/2019 Make Cab

    9/34

    Microsoft MakeCAB Users Gide

    .%et If7ileHea)er&'-;9)i"k (m#er:/9ca#iet (m#er:/9fileame:/9"i0e:- .%et If7ileHea)er'-;N!te 7ile i" !t i a ca#iet if ca#K i" >- .%et If7ileHea)er,'-- .%et If7ileLie7!rmat'-*)i"kK*/*ca#K*/*file*/*)ate*/*"i0e*-

    ."et GeerateIf'ON ; 6ifie) m!)e 3 create te IN7 file a" 8e +!

    ;** %et(p file". Te"e )!t ee) t! #e i te IN7 file/ "! 8e p(t ;

  • 8/13/2019 Make Cab

    10/34

    Microsoft MakeCAB Users Gide

    .%et IfCa#ietHea)er'-ca#iet li"tJ- .%et IfCa#ietHea)er&'-;9ca#iet (m#er:/9)i"k (m#er:/9ca#iet file ame:- .%et IfCa#ietLie7!rmat'-*ca#K*/*)i"kK*/*ca#file*-

    .%et If7ileHea)er'-;*** 7ile Li"t ***- .%et If7ileHea)er&'-;9)i"k (m#er:/9ca#iet (m#er:/9fileame:/9"i0e:-

    .%et If7ileHea)er'-;N!te 7ile i" !t i a ca#iet if ca#K i" >- .%et If7ileHea)er,'-- .%et If7ileLie7!rmat'-*)i"kK*/*ca#K*/*file*/*)ate*/*"i0e*-

    ;; *** Here i" 8ere 8e li"t all te file"; ."et GeerateIf'O77 ; =ELATIONAL MODE 3 D! )i"k la$!(t fir"t

    ;** %et(p file". Te"e )!t ee) t! #e i te IN7 file/ "! 8e p(t ;

  • 8/13/2019 Make Cab

    11/34

    Microsoft MakeCAB Users Gide

    ;** 7eat(re T8! file" .IfBe+i 7ile

    feat(re T8!J ;7ile" f!r feat(re T8! ;N!te tat "are).)ll i" al"! re(ire) #$ 7eat(re Oe .IfE)

    cliet&.exe "are).)ll a.#mp #.#mp c.#mp ).#mp

    ;*** Te E)

    The generated &'F file (ould look something like this:)i"k li"tJ

    ;9)i"k (m#er:/9)i"k la#el: &/-Di"k &-

    ca#iet li"tJ

    ;9ca#iet (m#er:/9)i"k (m#er:/9ca#iet file ame: &/&/ca#iet.&

    ;*** 7ile Li"t *** ;9)i"k (m#er:/9ca#iet (m#er:/9fileame:/9"i0e: ;N!te 7ile i" !t i a ca#iet if ca#K i" >

    feat(re OeJ ;7ile" f!r feat(re !e &/&/cliet&.exe/&

  • 8/13/2019 Make Cab

    12/34

    Microsoft MakeCAB Users Gide

    ;* IN7 p!rti!#ar

  • 8/13/2019 Make Cab

    13/34

    Microsoft MakeCAB Users Gide

    )FdirectivesRfile A file containing co%%ands for MA6CAB.66 to e-ecte. 0f%ore than one directive file is specified :@ file1 @ file" ...*$they are processed in the order :left to right* specified on theco%%and line. Laria&le settings$ open ca&inets$ open disks$ etc.are all carried for'ard fro% one directive file to the ne-t :Sst asif all of the files had &een concatenated together and presented

    as a single file to MakeCAB*. @or e-a%ple$ this is intended tosi%plify the 'ork for a prodct shipped in %ltiple langages.8here 'old &e a short$ langage5specific directives file$ andthen a single$ large %aster directives file that covers the &lk ofthe prodct.

    ).n =et de&gging ver&osity level :#Jnone$...$+Jfll*

    MA0CAB) %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-celdirectives file %ight look like)

    ;*** EXCEL MA@ECAB Directive file;

    .%et Di"kLa#el&'%et(p ; La#el !f fir"t )i"k

    .%et Di"kLa#el'Pr!+ram ; La#el !f "ec!) )i"k

    .%et Di"kLa#el,'-Pr!+ram C!ti(e)- ; La#el !f tir) )i"k

    .%et Ca#ietNameTemplate'EXCEL*.CAB ; EXCEL&.CAB/ EXCEL.CAB/ etc.

    .%et MaxDi"k%i0e'&.11M ; ,.2- )i"k"

    ;** %et(p.exe a) "et(p.if are place) (c!mpre""e) i te fir"t )i"k.%et Ca#iet'!ff.%et C!mpre""'!ff#i4"et(p.exe ; 5("t c!p$ %ET6P.EXE a" i"#i4"et(p.if ; 5("t c!p$ %ET6P.IN7 a" i";** Te re"t !f te file" are "t!re)/ c!mpre""e)/ i ca#iet file".%et Ca#iet'!.%et C!mpre""'!#i4excel.exe ; Bi+ EXE/ 8ill "pa ca#iet"

    #i4excel.lp#i4!lecli.)ll#i4!le"rv.)ll...

    2ere are so%e additional notes on the general synta- and &ehavior of MakeCAB irective @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 spply either a relative :e.g.$ fooT&ar$ ..Tfoo* or an

    a&solte :e.g.$ c)T&anana$ -)Tsl%TsrcT&in* path.

    1"*

  • 8/13/2019 Make Cab

    14/34

    Microsoft MakeCAB Users Gide

    &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 vales for co%%on disks si?es :C3

  • 8/13/2019 Make Cab

    15/34

    Microsoft MakeCAB Users Gide

    Disk-abelnJla&el !rinted disk la&el na%e for disk nDisk-abelTemplateJte%plate !rinted disk la&el na%e te%plate; Y is replaced &y disk n%&er Do'otCopyFilesJ+'X +FF Controls 'hether files are actally copied :ACM6 AM0.0@*FolderFileCountThresholdJcont 8hreshold cont of files per @older FolderSi!eThresholdJsi?e 8hreshold folder si?e for crrent folder /enerate&nfJ+'X +FF Control Unified vs. 3elation 0@ generation %ode&nf

    (xxJstring =et defalt vale for 0@ !ara%eter --

    &nfCabinet8eaderFnJstring 0@ ca&inet section header te-t&nfCabinet-ineFormatFnJfor%at string 0@ ca&inet section detail line for%at&nfCommentStringJstring 0@ co%%ent string&nfDateFormatJyyyy9mm9ddXmm)dd)yy

    0@ date for%at

    &nfDisk8eaderFnJstring 0@ disk section header te-t&nfDisk-ineFormatFnJfor%at string 0@ disk section detail line for%at&nfFile8eaderFnJstring 0@ file section header te-t&nfFile-ineFormatFnJfor%at string 0@ file section detail line for%at&nfFile'ameJfilena%e a%e of 0@ file&nfFooterFnJstring 0@ footer te-t&nf8eaderFnJstring 0@ header te-t&nfSection+rderJFD X C X FY 0@ section order :disk$ ca&inet$ file*Ma#CabinetSi!eJsi?e Ma-i%% ca&inet file si?e for crrent ca&inetMa#DiskFileCountJcont Ma-i%% cont of files per isk Ma#DiskSi!eFnJsi?e Ma-i%% disk si?eMa#"rrorsJcont Ma-i%% errors allo'ed &efore pass 1 ter%inates%eserePerCabinetSi!eJsi?e Base a%ont of space to reserve for @C36=63L6 data%eserePerDataBlockSi!eJsi?e A%ont of space to reserve in each data &lock %eserePerFolderSi!eJsi?e A%ont of additional space in @C36=63L6 for each folder %ptFile'ameJfilena%e a%e of 3!8 fileSourceDirJpath efalt path for sorce files$ni*ueFilesJ+' 1 +FF Control 'hether dplicate 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 thefor%atting of the NdetailO lines in the 0@ file. 8he synta- of the vales 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

    csto% para%eter. 8he vale sed for a para%eter is fond in the follo'ing order)""* 0f a para%eter is specified on a @ile Copy or @ile 3eference co%%and$ the specified vale is sed."+* 0f a varia&le 0nf--- is defined for this para%eter$ its vale is sed."* 8he para%eter is a standard para%ater$ and its defined vale is sed.

    * Braces PZ[P %ay &e sed to indicate portions of te-t pls e-actly one para%eter that are o%itted if thepara%eter vale is &lank. @or e-a%ple$ NZYidY$[YfileY$Ysi?eYO 'ill generate the follo'ing strings$depending pon the vales of id$ file$ and si?e)

    id file si?e

  • 8/13/2019 Make Cab

    16/34

    Microsoft MakeCAB Users Gide

    &'F Parameters

    8he follo'ing ta&le lists the standard para%eters that %ay &e specified in 0@ line for%ats and on @ile Copy and@ile 3eference co%%ands. 8he isk$ Ca&$ and @ile col%ns indicate 'hich para%eters are spported in the&nfDisk-ineFormat$ &nfCabinet-ineFormat$ and &nfFile-ineFormat$ respectively. 0n addition$ the @ile col%nalso indicates 'hich para%eters %ay &e specified on the @ile Copy and @ile 3eference co%%ands.

    !ara%eter

    isk Ca& @ile escription

    attr Qes @ile attri&tes :AJarchive$ 3Jread5only$ 2Jhidden$ =Jsyste%*cab Qes Qes Ca&inet n%&er :# %eans not in ca&inet$ 1 or higher is ca&inet n%&er*cabfile Qes Ca&inet file na%ecsum Qes Checks%date Qes @ile date :%%ddyy or yyyy5%%5dd$ depending pon &nfDateFormat*disk Qes Qes Qes isk n%&er :15&ased*file Qes estination file na%e in layot :in ca&inet or on a disk*file Qes estination file n%&er in layot :first file is 1$ second file is "$ ...*; the order of

    @ile Copy Co%%ands controls the file n%&er$ so in relational 0@ %ode theorder of @ile 3eference Co%%ands has no affect on the file n%&er.

    label Qes isk ser5reada&le la&el :vale co%es fro% Disk-abeln$ if defined$ andother'ise is constrcted fro% Disk-abelTemplate*.

    lang Qes angage :i.e.$ L63. info* in &ase 1#$ &lank separated if %ltiple valessi!e Qes @ile si?e :only affects vale 'ritten to 0@ file*time Qes @ile ti%e :hh)%%)ssFaXp*er Qes Binary @ile version :n.n.n.n &ase 1# for%at*ers Qes =tring @ile version 55 can &e different fro% er>

    4st as csto% 0@ para%eters can &e defined &y sing the ,Defineand ,Setco%%and :e.g.$ ,Set 0nfCsto%Jdefaltvale*$ the ,Setco%%and can also &e sed to override the vales of these para%eters. 8his is %ost o&viosly seflfor the date and timepara%eters$ as it provides a si%ple 'ay to Ndate sta%pO all the files in a layot; and for theattrpara%eter$ this provides a 'ay to force a consistent set of file attri&tes :co%%only sed to clear the read5onlyand 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 inclde a co%%ent at the end.Any te-t on the line follo'ing the co%%ent is ignored.

    sorce Fdestination F)&'FJ;"SX '+ F)$'&

  • 8/13/2019 Make Cab

    17/34

    Microsoft MakeCAB Users Gide

    )$'&*

    Cabinet 3 +' 6C6.66 55 nco%pressed$in a ca&inet.

    6C6.66 55 co%pressed$ in a ca&inet

    6-a%ples).%et C!mpre""'O77 ; T(r !ff c!mpre""i!

    .%et Ca#iet'O77 ; N! ca#iet file"et(p.exe

  • 8/13/2019 Make Cab

    18/34

    Microsoft MakeCAB Users Gide

    destination is the na%e of a file previosly specified in a @ile Copy co%%and as the destination in the layot:not the sorce>*. 8herefore$ $ni*ueFilesis re(ired to &e +'.

    )#Jyper%its standard and csto% 0@ para%eters to &e applied to a file reference co%%and. 8hese para%etersare %erged 'ith any para%eters specified on the referenced @ile Copy co%%and$ 'ith para%eters on the @ile3eference co%%and taking precedence.

    A para%eter N-O is defined to have the vale NyO :'hich %ay &e e%pty*. Votes can &e sed in NyO to inclde&lanks or other special characters. . =ee N0@ !ara%etersO on page 6rror) 3eference sorce not fondfor a listof 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 sch varia&le is defined$ then Jy 'ill generate an error. 8his &ehavior ensresthat there is a defalt vale for every para%eter$ and %akes it easier to catch inadvertent typing errors.

    6-a%ples).%et GeerateIf'O77 ; =elati!al IN7 m!)e; file la$!(t"et(p.exe >SJ

    .Defie %!(rceDir' ; %!(rceDir ' J

    .Defie c!tracti!'U)!tV ; c!tracti! ' )!tJ

    .Defie c!tracti!')!t ; c!tracti! ' )!tJ

    .Defie "!me%pace"' i tere ; "!me%pace" ' i tereJ

    .Defie "!meM!re'U #l(e )!+ U ; "!meM!re ' #l(e )!+ J

    !age 1H March "#$ 1997

  • 8/13/2019 Make Cab

    19/34

    Microsoft MakeCAB Users Gide

    ,Delete varia&le

    elete a varia&le definition.

    Qo %ay only delete varia&les that have &een created &y ,Define or ,Set co%%ands. =tandard MakeCABvaria&les %ay not &e deleted.

    6-a%ples).%et m$Waria#le'rai"i.Delete m$Waria#le ; Delete m$Waria#le

    ,Dump

    isplay 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.ote that the d%p 'ill &e displayed dring pass 1 and again dring pass ".

    6-a%ples).D(mp ; D(mp varia#le ta#le t! "t)!(t

    ,&nfBegin D&S@ 1 CAB&'"T 1 F&-"=tart a &lock of one or %ore lines to 'rite to the specified area of the 0@ file.

    8he lines in the &lock 'ill &e copied n%odified to the specified section of the 0@ file$ so no MakeCABvaria&le s&stittion 'ill &e perfor%ed. =i%ilarly$ MakeCAB 'ill not strip co%%ents.

    Use ,&nf2rite$ ,&nf2riteCabinet$ or ,&nf2riteDiskif yo need varia&le s&stittion.

    6-a%ples).IfBe+i )i"k ; Text f!r )i"k "ecti! !f IN7 file;Ti" i" a c!mmet f!r te )i"k "ecti!. MakeCAB 8ill !t pr!ce"";ti" lie/ "!/ f!r example/ SvarS 8ill !t #e "(#"tit(te)..IfE)

    ,&nf"nd

    8er%inate an .0nfBegin &lock.

    6-a%ples).IfE) ; Cl!"e a .IfBe+i #l!ck

    ,&nf2rite string

    ,ritestringto the file area of the 0@ file.

    ote that lines 'ill have MakeCAB co%%ents re%oved and varia&le vales s&stitted. 0f yo 'ant to avoidthis processing$ se the ,&nfBegin Fileco%%and. eading 'hitespace is nor%ally re%oved$ &t yo canoverride this &y placing 'hitespace in (otes :see e-a%ples &elo'*

    6-a%ples).IfRrite A %ecti! Hea)erJ ; Text f!r file "ecti!/ ti" c!mmet

    ; 8ill !t appear.

    .IfRrite ;9)i"k:/9file: ; MakeCAB "trip" !ff te c!mmet"/ "! ti"; c!mma) ("t 8rite" a #lak lie

    .IfRrite U;9)i"k:/9file:U ; Get tat c!mmet i te IN7 file

    !age 19 March "#$ 1997

  • 8/13/2019 Make Cab

    20/34

    Microsoft MakeCAB Users Gide

    .IfRrite U US"!meWarS ; Get lea)i+ "pace ! te IN7 lie

    ,&nf2riteCabinet string

    ,ritestringto the ca&inet area of the 0@ file.

    ote that lines 'ill have MakeCAB co%%ents re%oved and varia&le vales s&stitted. 0f yo 'ant to avoid

    this processing$ se the ,&nfBegin Cabinetco%%and.

    6-a%ples).IfRriteCa#iet 1>SS !ff $!(r fav!rite f(rit(re ; SS c!llap"e )!8 t! ; !e S/ #eca("e MakeCAB )!e" varia#le

    ; "(#"tit(ti! ! te "tri+.

    ,&nf2riteDisk string

    ,ritestringto the disk area of the 0@ file.

    ote that lines 'ill have MakeCAB co%%ents re%oved and varia&le vales s&stitted. 0f yo 'ant to avoidthis processing$ se the ,&nfBegin Diskco%%and.

    6-a%ples).IfRriteDi"k Te =ai i %pai fall" Mail$ ! te Plai

    ,'e( Disk X Cabinet 1 Folder

    @orce a disk$ ca&inet$ or folder &reak.

    8his is sed to co%plete the crrent disk$ ca&inet$ or folder$ and start a ne' one.

    6-a%ples).Ne8 Di"k ; %tart a e8 )i"k.Ne8 Ca#iet ; %tart a e8 ca#iet.Ne8 7!l)er ; %tart a e8 f!l)er

    ,Set varia&le3vale=et variable to &e e(al to value.

    8o se variable$ srrond it 'ith percent signs :* 55 varia&le.Using an ndefined varia&le is an error$ and 'ill case MakeCAB to stop &efore pass ".value %ay inclde references to other varia&les.

    value %ay &e e%pty$ in 'hich case variable is set to the e%pty string.eading and trailing &lanks in value are discarded.Blanks %ay &e enclose in (ote :N* or apostrophe :W* %arks.6-plicit percent signs :*$ (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.

    6-a%ples.%et la+'ENGLI%H ; %et la+(a+e.%et c!(tr$'6%A ; %et c!(tr$.%et %!(rceDir'Sla+S4Sc!(tr$S ; %!(rceDir ' ENGLI%H46%AJ.%et !i'Sla+SSc!(tr$S ; !i ' ENGLI%H6%AJ.%et "(cce""'&>>SS ; "(cce"" ' &>>SJ.%et %!(rceDir' ; %!(rceDir ' J.%et c!tracti!'U)!tV ; c!tracti! ' )!tJ

    !age "# March "#$ 1997

  • 8/13/2019 Make Cab

    21/34

    Microsoft MakeCAB Users Gide

    .%et c!tracti!')!t ; c!tracti! ' )!tJ

    .%et "!me%pace"' i tere ; "!me%pace" ' i tereJ

    .%et "!meM!re'U #l(e )!+ U ; "!meM!re ' #l(e )!+ J

    .ariable Details

    8he standard MakeCAB varia&les are listed &elo'. 8hese varia&les are predefined$ and each of the% have defalt

    vale$ 'hich is sed if yo do not set the varia&le fro% the co%%and line : varJvale* or prior to the ti%e yoe-plicitly set the varia&le 'ith a ,Defineor ,Setco%%and in a directive file.Qo can create yor o'n varia&les as 'ell$ sing the ,Define co%%and if yo specify ,+ption "#plict$ and the ,Setco%%and other'ise.

    CabinetJ+nX +ff

    8rns cabinet mode on or off.efalt) .=et Ca&inetJ

  • 8/13/2019 Make Cab

    22/34

    Microsoft MakeCAB Users Gide

    .%et Ca#iet7ileC!(tTre"!l)'&>> ; %!!t f!r &>> file" per ca#iet

    Cabinet'amenJfilena%e

    8he ca&inet file na%e for the specified ca&inet.efalt) ; By defalt none of these varia&les are defined

    0f this varia&le is not defined for a particlar disk$ then MakeCAB ses the Cabinet'ameTemplateto constrctthe ca&inet na%e.

    6-a%ples).%et Ca#ietName&'!e.ca#

    Cabinet'ameTemplateJte%plate

    =ets the ca&inet file na%e te%plate.efalt) .=et Ca&ineta%e8e%plateJY.CAB; 1.CAB$ ".CAB$ ...

    8his te%plate is sed to constrct the file na%e of each ca&inet. 8he PYP in this te%plate is replaced &y theca&inet n%&er :1$ "$ etc.*. 8his varia&le is sed only if no varia&le Cabinet'amene-ists for ca&inet n.

    '+T": Be sure that the e#panded cabinet name does not e#ceed the limits for your file system @ore-a%ple$ if yo sed NCAB068Y.CABO$ and MakeCAB had to create 1# or %ore ca&inets$ then yo'old have ca&inet na%es like CAB0681#.CAB$ 'hich is 9.+$ 'hich is an invalid na%e in the @A8file syste%. Unfortnately$ MakeCAB 'old not detect this ntil it had already created 9 ca&inets>

    6-a%ples).%et Ca#ietNameTemplate'EXCEL*.DIA ; EXCEL&.DIA/ EXCEL.DIA/ etc..%et Ca#ietNameTemplate'*. ; &/ / ,/ etc.

    Checksum2idthJ4X 5X ... X 6

    =ets the %a-i%% n%&er of lo'5order he- digits displayed &y &nfFile-ineFormatcsumpara%eter.efalt) .=et Checks%,idthJH ; efalt is all H he- digits :cs% is a +"5&it vale*

    8he presence of the csumpara%eter in the &nfFile-ineFormat varia&le cases MakeCAB to co%pte a +"5&itC3C for each file and 'rite that checks% to the 0@ file. ,hile leading ?eros are not 'ritten ot$ the presenceof these checks%s can significantly increase the si?e of the 0@ file. Qo can se Checksum2idth to restrictthe si?e of the checks% 'ritten to the 0@ file. 0f a vale less than H is specified$ then MakeCAB 'ill %askoff the high5order &its of the +"5&it checks% to prodce a vale for the 0@ file that is at %ost the n%&er ofhe- digits specified.

    6-a%ples).%et Ceck"(mRi)t'1 ; Ol$ )i"pla$ te l!8 !r)er 1 ex )i+it"

    ClusterSi!eJ&ytes!erClster

    8he clster si?e of the distri&tion %edia.efalt) .=et Clster=i?eJD1" ; 1.M and 1."M floppies have D1"5&yte clsters

    8his is sed &y MakeCAB to rond p the si?es of files and ca&inets to a clster &ondary$ 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 spply the kno'n clster si?e forthat disk si?e)

    4,M

    4,5M:4apanese 6C +.DO drive capacity*

    !age "" March "#$ 1997

  • 8/13/2019 Make Cab

    23/34

    Microsoft MakeCAB Users Gide

    4,5M

    5E@

    GE@

    CD%+M

    6-a%ples).%et Cl("ter%i0e'&.11M ; 6"e k!8 &.11M fl!pp$ if!

    CompressJ+'X +FF

    8rn file co%pression on or off.efalt) .=et Co%pressJ

  • 8/13/2019 Make Cab

    24/34

    Microsoft MakeCAB Users Gide

    efalt) .=et estinationirJ ; efalt is no path prefi-

    path is concatenated 'ith a path separator :NTO* and the target file na%e on @ile Copy Co%%ands to prodcethe file na%e that is stored in ca&inet file. 683AC8.66 'ill se this file na%e as the defalt na%e 'hen thefile is e-tracted.

    6-a%ples).%et De"tiati!Dir'%Y%TEM ; 7!ll!8i+ file" +et %Y%TEM prefix#i4A=IAL.TT7 ; Name i ca#iet i" %Y%TEM4A=IAL.TT7.%et De"tiati!Dir' ; N! prefix#i4A=IAL.TT7 ; Name i ca#iet i" A=IAL.TT7

    DiskDirectorynJdirectory

    8he otpt directory na%e for the specified disk.efalt) ; By defalt none of these varia&les are defined

    0f this varia&le is not defined for a particlar disk$ then MakeCAB ses the DiskDirectoryTemplatetoconstrct the disk directory.

    6-a%ples).%et Di"kDirect!r$&')i"k.!e

    DiskDirectoryTemplateJte%plate

    =et the otpt directory na%e te%plate.

  • 8/13/2019 Make Cab

    25/34

    Microsoft MakeCAB Users Gide

    =et the printed disk la&el. Used if individal Disk-abeln varia&les are not definedefalt) .=et iska&el8e%plateJNisk YO ; efalt is Nisk 1O$ Nisk "O$ etc.

    =ets the defalt 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-abelne-ists for disk n.

    6-a%ples).%et Di"kLa#elTemplate'UExcel Di"k *V

    Do'otCopyFilesJ+nX +ff

    Controls 'hether @ile Copy Co%%ands actally copy files.efalt) .=et ootCopy@ilesJ

  • 8/13/2019 Make Cab

    26/34

    Microsoft MakeCAB Users Gide

    /enerate&nf3+' 1 +FF

    Controls Unified vs. 3elational 0@ generation %ode.efalt) .=et Generate0nfJ

  • 8/13/2019 Make Cab

    27/34

    Microsoft MakeCAB Users Gide

    "E* 8o define a csto% 0@ para%eter$ and specify its defalt vale.

    otes):1* ,hen in 3elation 0@ %ode$ only the last aluefor a particlar &nf(xxvaria&le 'ill &e carried over fro%

    the layot section to the 0@ section of the @. 0n the follo'ing e-a%ple) ;** La$!(t "ecti! 3 7ile C!p$ c!mma)"

    .%et GeerateIf'O77 ; %elect =elati!al IN7

    .%et IfC("t!m'applefile.&.%et IfC("t!m'pearfile.;** IN7 "ecti! 3 7ile =eferece c!mma)".%et GeerateIf'ONfile.& ; *c("t!m* val(e i" UpearV/ !t UappleVfile.

    6-a%ples).%et IfDate'>2

  • 8/13/2019 Make Cab

    28/34

    Microsoft MakeCAB Users Gide

    8his is the string MakeCAB 'ill se to prefi- co%%ent lines that it generates in the 0@ :the atogeneratedMakeCAB versiondateti%e lines$ for e-a%ple*.

    &nfDateFormatJQQQQ5MM5 X MMQQ

    =ets the date for%at sed for dates 'ritten to the 0@ file.efalt) .=et 0nfate@or%atJMMQQ ; efalt to nor%al U= convention

    8his for%at is sed to for%at the datepara%eter for the &nfFile-ineFormat sed to 'rite file detail lines to the0@ file.

    6-a%ples).%et IfDate7!rmat'YYYY3MM3DD ; 6"e te preferre) ACME f!rmat

    &nfDisk8eaderFnJstring

    =ets the header te-t for the disk section of the 0@ file.efalt) .=et 0nfisk2eaderJPFdisk listP

    8his string is 'ritten to the 0@ 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 ot in

    increasing order after the &nfDisk8eader line. Any ,&nfBeginDisk,&nf"ndlines 'ill &e printed as they areencontered$ &t in any event after all of these header lines.

    6-a%ples).%et IfDi"kHea)er'U;L!t" ! Di"k"V

    .%et IfDi"kHea)er' ; N! Di"k ea)er

    .%et IfDi"kHea)er'U;Lie & !f Di"k"V

    .%et IfDi"kHea)er&'U;Lie !f Di"k"V

    .%et IfDi"kHea)er'U;Lie , !f Di"k"V

    &nfDisk-ineFormatFnJfor%at string

    =ets the detail line for%at for the disk section of the 0@ file.efalt) .=et 0nfiskine@or%atJYdisk\Y$Yla&elY

    8his for%at is sed to generate a line in the PdisksP section of the 0@. 0f a n%eric sffi- n is specified in thevaria&le na%e$ then the specified for%at is sed for disk n%&er n. 0f no sch disk n%&er5specific for%at isdefined$ then the vale of the &nfDisk-ineFormatvaria&le is sed.=ee N0nfiskCa&inet@ileine@or%at =ynta- and =e%anticsO on page 1Dfor details on the for%at string..=ee N0@ !ara%etersO on page1E for a list of the allo'ed para%eter na%es.

    &nfFile8eaderFnJstring

    =ets the header te-t for the file section of the 0@ file.efalt) .=et 0nf@ile2eaderJPFfile listP

    8his string is 'ritten to the 0@ 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 ot inincreasing order after the &nfFile8eader line. Any ,&nfBeginFile,&nf"ndlines 'ill &e printed as they areencontered$ &t in any event after all of these header lines.

    &nfFile-ineFormatFnJfor%at string

    =ets the detail line for%at for the file section of the 0@ file.efalt) .=et 0nf@ileine@or%atJYdisk\Y$Yca&\Y$YfileY$Ysi?eY

    !age "H March "#$ 1997

  • 8/13/2019 Make Cab

    29/34

    Microsoft MakeCAB Users Gide

    8his for%at is sed to generate a line in the PfileP section of the 0@. 0f a n%eric sffi- n is specified in thevaria&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 sch file n%&er5specific for%at is defined$then the vale of the &nfFile-ineFormatvaria&le is sed.=ee N0nfiskCa&inet@ileine@or%at =ynta- and =e%anticsO on page 1Dfor details on the for%at string..=ee N0@ !ara%etersO on page1E for a list of the allo'ed para%eter na%es.

    &nfFile'ameJfilena%e

    =ets the na%e of the 0@ otpt file.efalt) .=et 0nf@ilea%eJ=68U!.0@ ; efalt file na%e is =68U!.0@

    efines the file na%e for the 0@ file. 8his file has disk$ ca&inet$ and file infor%ation that is intended for se &ya setp progra% dring the setp process.

    6-a%ples).%et If7ileName'EXCEL.IN7

    &nfFooterFnJstring

    =ets the footer te-t for &eginning of the 0@ file.

    efalt) 3n MakeCAB and se the .%p co%%and to see the defalt footer

    8hese strings are 'ritten to the 0@ file after all other infor%ation. 8o disa&le this footer te-t$ set 0nf@ooter tothe e%pty string :.=et 0nf@ooterJ*. MakeCAB 'ill also se any varia&les of the for% &nfFootern'here n is aninteger 'ith no leading ?eros :#*. 8hese additional lines 'ill &e printed ot in increasing order after the&nfFooterline$ starting 'ith &nfFooter4.8he follo'ing special strings %ay &e specified in 0nf@ooterFn vales :note that the t'o percent signs arere(ired$ so that MakeCAB does not interpret these as varia&le references*)

    =tring escription

    1 8he co%%ent string 55 each 0nf@ooterFn line shold pro&a&ly start 'ith 1.

    " 8he date and ti%e MakeCAB 'as rn to prodce the 0@ file.

    + 8he version of MakeCAB se to prodce the 0@ file.

    6-a%ples).%et If7!!ter' ; Di"a#le IN7 f!!ter text.%et If7!!ter'USS& S S,V ; %!rt f!!ter.%et If7!!ter'USS&*****V ; L!+ f!!ter.%et If7!!ter&'USS&* SV ; L!+ f!!ter c!ti(e).%et If7!!ter'USS&* S,V ; L!+ f!!ter c!ti(e).%et If7!!ter,'USS&*****V ; L!+ f!!ter c!ti(e)

    &nf8eaderFnJstring

    =ets the header te-t for &eginning of the 0@ file.efalt) 3n MakeCAB and se the .%p co%%and to see the defalt header.

    8hese strings are 'ritten to the 0@ file prior to any other infor%ation. 8o disa&le this header te-t$ set0nf2eader 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 ot inincreasing order after the &nf8eaderline$ starting 'ith &nf8eader4.8he follo'ing special strings %ay &e specified in 0nf2eaderFn vales :note that the t'o percent signs arere(ired$ so that MakeCAB does not interpret these as varia&le references*)

    =tring escription

    1 8he co%%ent string 55 each 0nf2eaderFn line shold pro&a&ly start 'ith

    !age "9 March "#$ 1997

  • 8/13/2019 Make Cab

    30/34

    Microsoft MakeCAB Users Gide

    1." 8he date and ti%e MakeCAB 'as rn to prodce the 0@ file.+ 8he version of MakeCAB se to prodce the 0@ file.

    6-a%ples).%et IfHea)er' ; Di"a#le IN7 ea)er text

    .%et IfHea)er'USS& S S,V ; %!rt ea)er.%et IfHea)er'USS&*****V ; L!+ ea)er

    .%et IfHea)er&'USS&* SV ; L!+ ea)er c!ti(e)

    .%et IfHea)er'USS&* S,V ; L!+ ea)er c!ti(e)

    ,Set &nf8eader3HII4JJJJJK 0 -ong header continued&nfSection+rder3LD 1 C 1 FJ

    =et the generation and relative order of the isk$ Ca&inet$ and @ile sections in the 0@ file.efalt) .=et 0nf=ection ; 6"e )i"k "i0e a" limit

    Ma#DiskFileCountJcont

    =ets the %a-i%% n%&er of files that can &e stored on a disk.efalt) .=et Ma-isk@ileContJ# ; efalt is no li%it

    countis the %a-i%% n%&er of files to store on a disk.

  • 8/13/2019 Make Cab

    31/34

    Microsoft MakeCAB Users Gide

    4,5M:4apanese 6C +.DO drive capacity*4,5M

    5E@

    GE@

    CD%+M

    8he file cont does not inclde any files inside ca&inets. 6ach ca&inet conts as a single file for prposes ofthis cont.

    6-a%ples).%et Di"k7ileC!(tMax'2 ; Limit !f 2 file" per )i"k.%et Di"k7ileC!(tMax'&.11M ; 6"e limit f!r &.11M 7AT fl!pp$ )i"k

    Ma#DiskSi!eFnJsi?e

    =et the %a-i%% defalt si?e for a disk.efalt) .=et Ma-isk=i?eJ1.M ; efalt is 1.M floppy

    si)eis the %a-i%% defalt si?e for a disk. 8his varia&le is sed only for disks for 'hich a varia&leMa#DiskSi!enis not defined.

    0f Cabinet is +FF$ and the ne-t file to &e layed ot cannot fit on the crrent disk$ then MakeCAB 'ill %ove tothe ne-t disk. 0f Cabinet is +'$ then the crrent ca&inet 'ill se as %ch space on the crrent disk as possi&le.

    0fsi)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 tothe &yte)

    4,M

    4,5M:4apanese 6C +.DO drive capacity*4,5M

    5E@GE@

    CD%+M

    6-a%ples).%et MaxDi"k%i0e'> ; N! limit.%et MaxDi"k%i0e'CD=OM ; All file" are #ei+ place) ! a CD3=OM

    .%et MaxDi"k%i0e&'>@ ; 7ir"t )i"k i" >@

    .%et MaxDi"k%i0e'&.11M ; ... re"t are &.11M

    Ma#"rrorsJcont

    =et the %a-i%% n%&er of errors allo'ed &efore pass 1 ter%inates.efalt) .=et Ma-6rrorsJ"# ; efalt 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

  • 8/13/2019 Make Cab

    32/34

    Microsoft MakeCAB Users Gide

    .%et MaxErr!r"'2 ; Limit t! ("t a fe8

    %eserePerCabinetSi!eJsi?e

    =ets a fi-ed si?e to reserve in a ca&inet for the @C36=63L6 strctre.efalt) .=et 3eserve!erCa&inet=i?eJ# ; efalt is to reserve no space

    si)e is the a%ont of space to reserve in a ca&inet for the @C36=63L6 strctre. 8he total si?e of the@C36=63L6 strctre is the vale of this varia&le pls the n%&er of folders in the ca&inet ti%es the vale ofthe %eserePerFolderSi!e varia&le.

    si)e %st &e a %ltiple of :to ensre %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% vale %ight &e stored here to per%itvalidation that the key &eing sed to decrypt the ca&inet is actally the one that 'as sed to encrypt the ca&inet.

    MakeCAB fills this reserved section 'ith ?eros.

    6-a%ples).%et =e"ervePerCa#iet%i0e'Z ; 7!r ("e a" a cr$pt!"$"tem ke$ ceck"(m

    %eserePerDataBlockSi!eJsi?e

    =ets the a%ont of space to reserve in each ata Block header.efalt) .=et 3eserve!erataBlock=i?eJ# ; efalt is to reserve no space

    si)e is the a%ont of space to reserve in each ata Block header. 8his space is located after the standard ataBlock header and &efore the data for the data &lock.

    si)e %st &e a %ltiple of :to ensre %e%ory align%ent on certain syste%s*.

  • 8/13/2019 Make Cab

    33/34

    Microsoft MakeCAB Users Gide

    6-a%ples).%et =e"ervePerCa#iet%i0e'Z ; %i0e !f a =C1 cr$pt!"$"tem ke$

    %ptFile'ameJfilena%e

    =ets the na%e of the 3!8 otpt file.efalt) .=et 3pt@ilea%eJ=68U!.3!8 ; efalt file na%e is =68U!.3!8

    efines the file na%e for the 3!8 file. 8his file has s%%ary infor%ation on the MakeCAB rn.

    6-a%ples).%et =pt7ileName'EXCEL.=PT

    SourceDirJpath

    8he defalt path sed to locate sorce files specified in @ile Copy Co%%ands.efalt) .=et =orceirJ ; efalt is to look in the crrent directory

    path is concatenated 'ith a path separator :NTO* and the sorce file na%e on the @ile Copy Co%%and to prodcethe file na%e sed to find the sorce file.

    0fpath is e%pty$ then the sorce file na%e specified on the @ile Copy Co%%and is not %odified.

    6-a%ples).%et %!(rceDir'C4P=O5ECT ; 7i) all "!(rce file" i c4pr!ect

    $ni*ueFilesJ+' X+FF

    Controls 'hether destination file na%es in a layot %st &e ni(e..efalt) .=et Uni(e@ilesJP

  • 8/13/2019 Make Cab

    34/34

    Microsoft MakeCAB Users Gide

    (*AC()

    6-tract spports co%%and5line e-traction of files fro% ca&inet files.

    extract /yJ /AJ /D[/EJ /L locationJ cabinet_filefile_spec...Jextract/yJ compressed_filedestination_fileJ

    ='itches))A !rocess all files in a ca&inet set$ starting 'ith the cabinet_file.

    )D