title: Extract .cab file in C#
body: <p>I am developing a c# application and I a need to extract a cab file.</p>
  
  <p>I couldn't find a library that does that in C# ) I cannot use Microsoft.Deployment.Compression.Cab.dll because of a licensing issue.</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/8533105/minimum-c-sharp-code-to-extract-from-cab-archives-or-infopath-xsn-files-in-mem">this</a> code, but the problem is that when I use it I am able to find and extract only the first file in the cabinet. </p>
  
  <p>OutputFileClose is called only if OutputFileOpen returns something either then IntPtr.Zero.
  but if OutputFileClose is calles, then the enumeration is stopped.
  So for this code OutputFileClose can be called only for one file</p>
  
  <p>Can someone please help me figuring out how to write a code that will extract all the files?</p>