Generate File Cabinet
The VBScript file WiMakCab.vbs is provided in the Windows SDK Components for Windows Installer Developers. This sample shows how script is used to generate file cabinets from a Windows Installer database.
This sample demonstrates:
- OpenDatabase method (Installer Object) and the LastErrorRecord method of the Installer Object
- Commit method, the OpenView method and SummaryInformation property (Database Object) of the Database Object
- Fetch method, Execute method and Modify method of the View Object
- StringData property and IntegerData property of the Record Object
- DoAction method, the Property property (Session Object), and the Mode property of the Session Object
You'll require the CScript.exe or WScript.exe version of Windows Script Host to use this sample. To use CScript.exe to run this sample, type a command at the command prompt using the following syntax. Help is displayed if the first argument is /? or if too few arguments are specified. To redirect the output to a file, end the command line with VBS > [path to file]. The sample returns a value of 0 for success, 1 if help is invoked, and 2 if the script fails.
cscript WiMakCab.vbs [path to database][base name][optional source locations]
In order to generate a cabinet, Makecab.exe must be on the PATH. The Makecab.exe utility is included in the Windows SDK Components for Windows Installer Developers. Note that the sample does not update the Media table to handle multiple cabinets. To replace an embedded cabinet, include the options: /R /C /U /E.
Specify the path to the installer database. This must be located at the root of the source tree. Specify the case-sensitive base name for the generated cabinet files. If the source type is compressed, all files are opened at the root. The following options may be specified at any point on the command line.
|no option specified|
|/C||Run compression. If /C is not specified, WiMakCab.vbs only generates the DDF file.|
|/L||Use LZX compression instead of MSZIP|
|/F||Limit cabinet size to 1.44 MB floppy size rather than CD-ROM|
|/U||Update the database to reference the generated cabinet|
|/E||Embed the cabinet file in the installer package as a stream|
|/S||Use sequence numbers in the File table ordered by directories|
|/R||Revert to non-cabinet install, remove cabinet if /E is specified (The /R option removes the compressed bit - SummaryInfo property 15 & 2)|
Build date: 11/16/2013