MAKECAB Directive File syntax

Directives begin with a period ("."), followed by a command name, and possibly by (blank delimited) arguments.

SyntaxDescription
;Comment (anywhere on a DDF line)
The ; character is also a standard batch file delimiter so this makes it possible to create a self-contained batch file/directive script, lines prefixed with ; will be commented out only for makecab.
src [dest] [/inf=yes|no] [/unique=yes|no] [/x=y ...]File Copy command
dest [/x=y ...]File Reference command
.Define variable=[value]Define variable to be equal to value (see .Option Explicit)
.Delete variableDelete a variable definition
.Dump Display all variable definitions
.InfBegin Disk | Cabinet | Folder Copy lines to specified INF file section
.InfEnd End an .InfBegin section
.InfWrite stringWrite "string" to file section of INF file
.InfWriteCabinet stringWrite "string" to cabinet section of INF file
.InfWriteDisk stringWrite "string" to disk section of INF file
.New Disk | Cabinet | Folder Start a new Disk, Cabinet, or Folder
.Option Explicit Require .Define first time for user-defined variables
.Set variable=[value]Set variable to be equal to value
%variable%Substitute value of variable
<blank line>Blank lines are ignored

Variable Summary

Standard VariablesDescription
Cabinet=ON | OFFTurns Cabinet Mode on or off
CabinetFileCountThreshold=countThreshold count of files per Cabinet
CabinetNamen=filenameCabinet file name for cabinet number n
CabinetNameTemplate=templateCabinet file name template; * is replaced by Cabinet number
ChecksumWidth=1 | 2 | ... | 8Max low-order hex digits displayed by INF csum parameter
ClusterSize=bytesPerClusterCluster size on diskette (default is 512 bytes)
Compress=ON | OFFTurns compression on or off
CompressedFileExtensionChar=charLast character of the file extension for compressed files
CompressionMemory=15 | 16 | ... | 21The window size for LZX compression
CompressionType=MSZIP | LZXCompression engine
DestinationDir=pathDefault path for destination files (stored in cabinet file)
DiskDirectoryn=directoryOutput directory name for disk n
DiskDirectoryTemplate=templateOutput directory name template; * is replaced by disk number
DiskLabeln=labelPrinted disk label name for disk n
DiskLabelTemplate=templatePrinted disk label name template; * is replaced by disk number
DoNotCopyFiles= ON | OFFControls whether files are actually copied (ACME ADMIN.INF)
FolderFileCountThreshold=countThreshold count of files per Folder
FolderSizeThreshold=sizeThreshold folder size for current folder
GenerateInf=ON | OFF Control Unified vs. Relation INF generation mode.
A File Copy command is distinguished from a File Reference command by
the setting of the GenerateInf variable.
InfXxx=stringSet default value for INF Parameter Xxx
InfCabinetHeader[n]=stringINF cabinet section header text
InfCabinetLineFormat[n]=format stringINF cabinet section detail line format
InfCommentString=stringINF comment string
InfDateFormat=yyyy-mm-dd | mm/dd/yyINF date format
InfDiskHeader[n]=stringINF disk section header text
InfDiskLineFormat[n]=format stringINF disk section detail line format
InfFileHeader[n]=stringINF file section header text
InfFileLineFormat[n]=format stringINF file section detail line format
InfFileName=filenameName of INF file
InfFooter[n]=stringINF footer text
InfHeader[n]=stringINF header text
InfSectionOrder=[D | C | F]*INF section order (disk, cabinet, file)
MaxCabinetSize=sizeMaximum cabinet file size for current cabinet
MaxDiskFileCount=countMaximum count of files per Disk
MaxDiskSize[n]=sizeMaximum disk size
MaxErrors=countMaximum errors allowed before pass 1 terminates
ReservePerCabinetSize=sizeBase amount of space to reserve for FCRESERVE data
ReservePerDataBlockSize=sizeAmount of space to reserve in each data block
ReservePerFolderSize=sizeAmount of additional space in FCRESERVE for each folder
RptFileName=filenameName of RPT file
SourceDir=pathDefault path for source files
UniqueFiles=ON | OFFControl whether duplicate destination file names are allowed

Store the directives in a .ddf (ascii text) file and call with MAKECAB /F

If .Option Explicit is specified, then you must first use .Define to define any user-defined variables before you can use .Set to modify them.

For standard MakeCAB variables, .Define is not permitted, and only .Set may be used.
If .Option Explicit is not specified, then .Define is equivalent to .Set.

INF Parameters

Parameter Disk Cab File  Description 
  attr             Yes   File attributes (A=archive, R=read-only, H=hidden, S=system) 
  cab#         Yes Yes   Cabinet number (0 means not in cabinet, 1 or higher is cabinet number)
 cabfile       Yes       Cabinet file name
  csum             Yes   Checksum
  date             Yes   File date (mm/dd/yy or yyyy-mm-dd, depending upon InfDateFormat)
  disk#   Yes  Yes Yes   Disk number (1-based)
  file             Yes   Destination file name in layout (in cabinet or on a disk)
  file#            Yes   Destination file number in layout (first file is 1, second file is 2, ...);
                         the order of File Copy Commands controls the file number, so in relational
                         INF mode the order of File Reference Commands has no affect on the file number.
  label   Yes            Disk user-readable label (value comes from DiskLabeln, if defined, and
                         otherwise is constructed from DiskLabelTemplate).
  lang             Yes   Language (i.e., VER.DLL info) in base 10, blank separated if multiple values
  size             Yes   File size (only affects value written to INF file)
  time             Yes   File time (hh:mm:ss[a|p])
  ver              Yes   Binary File version (n.n.n.n base 10 format)
  vers             Yes   String File version -- can be different from ver!
  attr             Yes  File attributes (A=archive, R=read-only, H=hidden, S=system)

“One resolution I have made, and try always to keep, is this: To rise above little things” - John Burroughs

Related:

MakeCab users guide - Extensive makecab documentation from Microsoft.
MAKECAB - Create .CAB files


© Copyright SS64.com 1999-2014
Some rights reserved