Показать сообщение отдельно
  #2  
Старый 11.08.2018, 14:26
Аватар для Aqel
Aqel Aqel вне форума
Прохожий
 
Регистрация: 08.10.2011
Адрес: Пермь
Сообщения: 13
Версия Delphi: XE8 SP1
Репутация: 10
По умолчанию

Вот нашёл:
Код:
uses
   JclCompression;

procedure TfrmSevenZipTest.Button1Click(Sender: TObject);
const
   FILENAME = 'F:\temp\test.zip';
var
   archiveclass: TJclDecompressArchiveClass;
   archive: TJclDecompressArchive;
   item: TJclCompressionItem;
   s: String;
   i: Integer;
begin
   archiveclass:= GetArchiveFormats.FindDecompressFormat(FILENAME);
   if not Assigned(archiveclass) then
      raise Exception.Create('Could not determine the Format of ' + FILENAME);
   archive:= archiveclass.Create(FILENAME);
   try
      if not (archive is TJclSevenZipDecompressArchive) then
         raise Exception.Create('This format is not handled by 7z.dll');
      archive.ListFiles;
      s:= Format('test.zip Item Count: %d'#13#10#13#10, [archive.ItemCount]);
      for i:= 0 to archive.ItemCount - 1 do
      begin
         item:= archive.Items[i];
         case item.Kind of
            ikFile:
               s:= s + IntToStr(i+1) + ': ' + item.PackedName + #13#10;
            ikDirectory:
               s:= s + IntToStr(i+1) + ': ' + item.PackedName + '\'#13#10;//'
         end;
      end;
      if archive.ItemCount > 0 then
      begin
//         archive.Items[0].Selected := true;
//         archive.ExtractSelected('F:\temp\test');
         archive.ExtractAll('F:\temp\test');
      end;
      ShowMessage(s);
   finally
      archive.Free;
   end;
end;

Распаковывает ВЕСЬ архив отлично, но как сделать только то что мне нужно распаковать (папки/файлы) ?
__________________
Всё намного проще, чем есть на самом деле...
Ответить с цитированием