OSDN Git Service

na-get-lib, 7-Zipがインストールされているならば 7z.exe で展開するコードを追加 (cab他対策)。
[applistation/AppliStation.git] / na-get-lib / NaGet.ArchiveExtractionHelpers / ArchiveExtract.cs
1 using System;
2 using System.IO;
3 using System.Text;
4
5 namespace NaGet.ArchiveExtractionHelpers
6 {
7         public class ArchiveExtract
8         {
9                 private ArchiveExtract()
10                 {
11                 }
12                 
13                 public static bool Extract(string arcFile, string extractDestDir)
14                 {
15                         bool ret = false;
16                         
17                         if (ret == false) {
18                                 StringBuilder output = new StringBuilder(1024);
19                                 ret = NaGet.InteropServices.CommonArchiverExtracter.ExtractArchive(arcFile, extractDestDir, output, IntPtr.Zero);
20                         }
21                         
22                         if (ret == false) {
23                                 ret = SevenZipExtract.ExtractArchive(arcFile, extractDestDir);
24                         }
25                         
26                         return ret;
27                 }
28         }
29 }