![Copy image Copy image](copycode.gif)
![CopyHover image CopyHover image](copycodeHighlight.gif)
Deployment Tools Foundation
Pack Method (streamContext, files, maxArchiveSize)
Deployment Tools Foundation Namespaces ► Microsoft.Deployment.Compression.Cab ► CabEngine ► Pack(IPackStreamContext, IEnumerable<(Of <<'(String>)>>), Int64)
Creates a cabinet or chain of cabinets.
![](collapse_all.gif)
C# | Visual Basic | Visual C++ |
public override void Pack( IPackStreamContext streamContext, IEnumerable<string> files, long maxArchiveSize )
Public Overrides Sub Pack ( streamContext As IPackStreamContext, files As IEnumerable(Of String), maxArchiveSize As Long )
public: virtual void Pack( IPackStreamContext^ streamContext, IEnumerable<String^>^ files, long long maxArchiveSize ) override
![](collapse_all.gif)
- streamContext (IPackStreamContext)
- A context interface to handle opening and closing of cabinet and file streams.
- files (IEnumerable<(Of <(<'String>)>)>)
- The paths of the files in the archive (not external file paths).
- maxArchiveSize (Int64)
- The maximum number of bytes for one cabinet before the contents are chained to the next cabinet, or zero for unlimited cabinet size.
![](collapse_all.gif)
The stream context implementation may provide a mapping from the
file paths within the cabinet to the external file paths.
Smaller folder sizes can make it more efficient to extract individual files out of large cabinet packages.
![](collapse_all.gif)
Exception | Condition |
---|---|
ArchiveException | The cabinet could not be
created. |
Assembly: Microsoft.Deployment.Compression.Cab (Module: Microsoft.Deployment.Compression.Cab.dll) Version: 3.0.0.0 (3.9.1006.0)