Example #1
0
 private void HandleCurrentFile(byte[] data)
 {
     if (IsManifest)
     {
         var Manifest = new TSOManifest(Encoding.Default.GetString(data));
         SetupFiles.Clear();
         foreach (var entry in Manifest.Entries)
         {
             if (!entry.Filename.EndsWith(".cab"))
             {
                 SetupFiles.Enqueue(entry);
             }
         }
         IsManifest = false;
         TotalFiles = SetupFiles.Count;
     }
     else
     {
         var destPath = "Packed/" + CurrentFile.Filename;
         var dir      = Path.GetDirectoryName(destPath);
         if (!Directory.Exists(dir))
         {
             Directory.CreateDirectory(dir);
         }
         using (var targetFile = File.Create(destPath))
         {
             targetFile.Write(data, 0, data.Length);
         }
     }
 }
Example #2
0
 private void HandleCurrentFile(byte[] data)
 {
     if (IsManifest)
     {
         var Manifest = new TSOManifest(Encoding.Default.GetString(data));
         SetupFiles.Clear();
         foreach (var entry in Manifest.Entries)
         {
             if (!entry.Filename.EndsWith(".cab")) SetupFiles.Enqueue(entry);
         }
         IsManifest = false;
         TotalFiles = SetupFiles.Count;
     }
     else
     {
         var destPath = "Packed/" + CurrentFile.Filename;
         var dir = Path.GetDirectoryName(destPath);
         if (!Directory.Exists(dir)) Directory.CreateDirectory(dir);
         using (var targetFile = File.Create(destPath))
         {
             targetFile.Write(data, 0, data.Length);
         }
     }
 }