[This is preliminary documentation and subject to change.]
The AddFile method adds a file to a cabinet file.
object.AddFile( sFile, sCabFileName )
When you are adding files to a cabinet file, your application should ensure that the total size of files added does not exceed the value of lMediaSize specified when the cabinet was created. If your application needs to add additional files after the size limit is reached, it must create a new cabinet to hold the extra files.
The EnhCab object does not support linked cabinet files. In other words, you cannot store part of a file or folder in one cabinet and the rest in another cabinet.
Windows NT: Unsupported.
Windows: Requires Windows 98.
Windows CE: Unsupported.
Header: Declared in ipenhsnd.idl.
Import Library: Included as a resource in ipenhsnd.dll.
Unicode: Yes.
EnhCab.NewCabinet, EnhCab.CloseCabinet
The following example creates a new cabinet file, Cab1.cab, and stores two files in it.
'Create an instance of an EnhCab object
'and store it in the ecab variable
Dim ecab As EnhCab
Set ecab = New EnhCab
'Create the cabinet file
ecab.NewCabinet "Cab1.cab", 2000000, 2000000, 1
'Add files to the cabinet file
ecab.AddFile "C:\File1.htm", "File1.htm"
ecab.AddFile "C:\File2.htm", "File1.htm"
'Close the cabinet file and write it to disk
ecab.CloseCabinet