diff options
Diffstat (limited to 'src/samples/Dtf/Documents/Guide/Content/cabs.htm')
-rw-r--r-- | src/samples/Dtf/Documents/Guide/Content/cabs.htm | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/src/samples/Dtf/Documents/Guide/Content/cabs.htm b/src/samples/Dtf/Documents/Guide/Content/cabs.htm new file mode 100644 index 00000000..e88d1e15 --- /dev/null +++ b/src/samples/Dtf/Documents/Guide/Content/cabs.htm | |||
@@ -0,0 +1,101 @@ | |||
1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
2 | <head> | ||
3 | <title>Working with Cabinet Files</title> | ||
4 | <link rel="stylesheet" type="text/css" href="../styles/presentation.css" /> | ||
5 | <link rel="stylesheet" type="text/css" href="ms-help://Hx/HxRuntime/HxLink.css" /> | ||
6 | </head> | ||
7 | |||
8 | <body> | ||
9 | |||
10 | <div id="control"> | ||
11 | <span class="productTitle">Deployment Tools Foundation</span><br /> | ||
12 | <span class="topicTitle">Working with Cabinet Files</span><br /> | ||
13 | <div id="toolbar"> | ||
14 | <span id="chickenFeet"> | ||
15 | <a href="using.htm">Development Guide</a> > | ||
16 | <span class="nolink">Cabinet Files</span> | ||
17 | </span> | ||
18 | </div> | ||
19 | </div> | ||
20 | <div id="main"> | ||
21 | <div id="header"> | ||
22 | </div> | ||
23 | <div class="summary"> | ||
24 | |||
25 | <h3>Creating a cabinet</h3> | ||
26 | <pre><font face="Consolas, Courier New"> CabInfo cabInfo = <font color="blue">new</font> CabInfo(<font color="purple">"package.cab"</font>); | ||
27 | cabInfo.Pack(<font color="purple">"D:\\FilesToCompress"</font>);</font></pre><br /> | ||
28 | <p>1. Create a <a href="DTFAPI.chm::/html/M_Microsoft_Deployment_Compression_Cab_CabInfo__ctor_1.htm">new CabInfo</a> instance referring to the (future) location of the .cab file.</p> | ||
29 | <p>2. Compress files:</p><ul> | ||
30 | <li>Easily compress an entire directory with the <a href="DTFAPI.chm::/html/Overload_Microsoft_Deployment_Compression_ArchiveInfo_Pack.htm">Pack</a> method.</li> | ||
31 | <li>Compress a specific list of exernal and internal filenames with the <a href="DTFAPI.chm::/html/Overload_Microsoft_Deployment_Compression_ArchiveInfo_PackFiles.htm">PackFiles</a> method.</li> | ||
32 | <li>Compress a dictionary mapping of internal to external filenames with the <a href="DTFAPI.chm::/html/Overload_Microsoft_Deployment_Compression_ArchiveInfo_PackFileSet.htm">PackFileSet</a> method.</li> | ||
33 | </ul> | ||
34 | |||
35 | <p><br/></p> | ||
36 | <h3>Listing a cabinet</h3> | ||
37 | <pre><font face="Consolas, Courier New"> CabInfo cabInfo = <font color="blue">new</font> CabInfo(<font color="purple">"package.cab"</font>); | ||
38 | <font color="blue">foreach</font> (CabFileInfo fileInfo <font color="blue">in</font> cabInfo.GetFiles()) | ||
39 | Console.WriteLine(fileInfo.Name + <font color="purple">"\t"</font> + fileInfo.Length);</font></pre><br /> | ||
40 | <p>1. Create a <a href="DTFAPI.chm::/html/M_Microsoft_Deployment_Compression_Cab_CabInfo__ctor_1.htm">new CabInfo</a> instance referring to the location of the .cab file.</p> | ||
41 | <p>2. Enumerate files returned by the <a href="DTFAPI.chm::/html/Overload_Microsoft_Deployment_Compression_Cab_CabInfo_GetFiles.htm">GetFiles</a> method.</p><ul> | ||
42 | <li>Each <a href="DTFAPI.chm::/html/T_Microsoft_Deployment_Compression_Cab_CabFileInfo.htm">CabFileInfo</a> instance contains metadata about one file.</li> | ||
43 | </ul> | ||
44 | |||
45 | <p><br/></p> | ||
46 | <h3>Extracting a cabinet</h3> | ||
47 | <pre><font face="Consolas, Courier New"> CabInfo cabInfo = <font color="blue">new</font> CabInfo(<font color="purple">"package.cab"</font>); | ||
48 | cabInfo.Unpack(<font color="purple">"D:\\ExtractedFiles"</font>);</font></pre><br /> | ||
49 | <p>1. Create a <a href="DTFAPI.chm::/html/M_Microsoft_Deployment_Compression_Cab_CabInfo__ctor_1.htm">new CabInfo</a> instance referring to the location of the .cab file.</p> | ||
50 | <p>2. Extract files:</p><ul> | ||
51 | <li>Easily extract all files to a directory with the <a href="DTFAPI.chm::/html/Overload_Microsoft_Deployment_Compression_ArchiveInfo_Unpack.htm">Unpack</a> method.</li> | ||
52 | <li>Easily extract a single file with the <a href="DTFAPI.chm::/html/M_Microsoft_Deployment_Compression_ArchiveInfo_UnpackFile.htm">UnpackFile</a> method.</li> | ||
53 | <li>Extract a specific list of filenames with the <a href="DTFAPI.chm::/html/Overload_Microsoft_Deployment_Compression_ArchiveInfo_UnpackFiles.htm">UnpackFiles</a> method.</li> | ||
54 | <li>Extract a dictionary mapping of internal to external filenames with the <a href="DTFAPI.chm::/html/Overload_Microsoft_Deployment_Compression_ArchiveInfo_UnpackFileSet.htm">UnpackFileSet</a> method.</li> | ||
55 | </ul> | ||
56 | |||
57 | <p><br/></p> | ||
58 | <h3>Getting progress</h3> | ||
59 | Most cabinet operation methods have an overload that allows you to specify a event handler | ||
60 | for receiving <a href="DTFAPI.chm::/html/T_Microsoft_Deployment_Compression_ArchiveProgressEventArgs.htm">archive | ||
61 | progress events</a>. The <a href="cabpack.htm">XPack sample</a> | ||
62 | demonstrates use of the callback to report detailed progress to the console. | ||
63 | |||
64 | <p><br/></p> | ||
65 | <h3>Stream-based compression</h3> | ||
66 | The CabEngine class contains static methods for performing compression/decompression operations directly | ||
67 | on any kind of Stream. However these methods are more difficult to use, since the caller must implement a | ||
68 | <a href="DTFAPI.chm::/html/T_Microsoft_Deployment_Compression_ArchiveFileStreamContext.htm">stream context</a> | ||
69 | that provides the file metadata which would otherwise have been provided by the filesystem. The CabInfo class | ||
70 | uses the CabEngine class with FileStreams to provide the more traditional file-based interface. | ||
71 | |||
72 | <p><br/></p> | ||
73 | <p><b>See also:</b></p> | ||
74 | <ul> | ||
75 | <li><a href="DTFAPI.chm::/html/T_Microsoft_Deployment_Compression_Cab_CabInfo.htm">CabInfo class</a></li> | ||
76 | <li><a href="DTFAPI.chm::/html/T_Microsoft_Deployment_Compression_Cab_CabEngine.htm">CabEngine class</a></li> | ||
77 | <li><a href="cabpack.htm">XPack Sample Tool</a></li> | ||
78 | </ul> | ||
79 | <p><br/></p> | ||
80 | |||
81 | </div> | ||
82 | |||
83 | <div id="footer"> | ||
84 | <p /> | ||
85 | Send comments on this topic to <a id="HT_MailLink" href="mailto:wix-users%40lists.sourceforge.net?Subject=Deployment Tools Foundation Documentation"> | ||
86 | wix-users@lists.sourceforge.net</a> | ||
87 | |||
88 | <script type="text/javascript"> | ||
89 | var HT_mailLink = document.getElementById("HT_MailLink"); | ||
90 | var HT_mailLinkText = HT_mailLink.innerHTML; | ||
91 | HT_mailLink.href += ": " + document.title; | ||
92 | HT_mailLink.innerHTML = HT_mailLinkText; | ||
93 | </script> | ||
94 | |||
95 | <p /> | ||
96 | |||
97 | </div> | ||
98 | </div> | ||
99 | |||
100 | </body> | ||
101 | </html> | ||