Стартовый пул

This commit is contained in:
2024-04-02 08:46:59 +03:00
parent fd57fffd3a
commit 3bb34d000b
5591 changed files with 3291734 additions and 0 deletions

View File

@@ -0,0 +1,210 @@
////////////////////////////////////////////////////////////////////////////////
//
// ****************************************************************************
// * Project : FWZip
// * Unit Name : CreateZIPDemo1
// * Purpose : Демонстрация создания архива используя различные
// * : варианты добавления данных
// * Author : Александр (Rouse_) Багель
// * Copyright : © Fangorn Wizards Lab 1998 - 2023.
// * Version : 2.0.0
// * Home Page : http://rouse.drkb.ru
// * Home Blog : http://alexander-bagel.blogspot.ru
// ****************************************************************************
// * Stable Release : http://rouse.drkb.ru/components.php#fwzip
// * Latest Source : https://github.com/AlexanderBagel/FWZip
// ****************************************************************************
//
// Используемые источники:
// ftp://ftp.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
// https://zlib.net/zlib-1.2.13.tar.gz
// http://www.base2ti.com/
//
// Данный пример показывает различные варианты добавления информации в архив
// Для каждого из способов добавления в архиве будет создана отдельная папка
program CreateZIPDemo1;
{$IFDEF FPC}
{$MODE Delphi}
{$H+}
{$ELSE}
{$APPTYPE CONSOLE}
{$ENDIF}
uses
SysUtils,
Classes,
TypInfo,
FWZipWriter,
FWZipUtils;
procedure CheckResult(Value: Integer);
begin
if Value < 0 then
raise Exception.Create('Ошибка добавления данных');
end;
var
Zip: TFWZipWriter;
S: TStringStream;
PresentFiles: TStringList;
SR: TSearchRec;
I, ItemIndex: Integer;
BuildZipResult: TBuildZipResult;
begin
SetCurrentDir(ExtractFilePath(ParamStr(0)));
try
Zip := TFWZipWriter.Create;
try
// У всего архива включим UTF8 кодировку (если необходимо)
Zip.UseUTF8String := True;
// добавим комментарий по необходимости
Zip.Comment := 'Общий комментарий к архиву';
// Сначала добавим в архив файлы и папки
// не существующие физически на диске
// Создаем и добавляем текстовый файл в корень архива (AddStream)
{$IFDEF FPC}
S := TStringStream.Create(AnsiString('Тестовый текстовый файл №1'));
{$ELSE}
S := TStringStream.Create('Тестовый текстовый файл №1');
{$ENDIF}
try
S.Position := 0;
ItemIndex := Zip.AddStream('test.txt', S);
CheckResult(ItemIndex);
// Можно добавить коментарий к самому элементу
Zip.Item[ItemIndex].Comment := 'Мой тестовый комментарий';
finally
S.Free;
end;
// Создаем и добавляем текстовый файл в корень архива (AddStream)
// владельцем стрима данных будет сам архив
{$IFDEF FPC}
S := TStringStream.Create(AnsiString('Тестовый текстовый файл №2'));
{$ELSE}
S := TStringStream.Create('Тестовый текстовый файл №2');
{$ENDIF}
S.Position := 0;
ItemIndex := Zip.AddStream('Тестовый файл номер №2.txt', S, soOwned);
CheckResult(ItemIndex);
// Для сохранении файла в определенной папке
// достаточно указать ее наличие в пути к файлу, например вот так
{$IFDEF FPC}
S := TStringStream.Create(AnsiString('Тестовый текстовый файл №3'));
{$ELSE}
S := TStringStream.Create('Тестовый текстовый файл №3');
{$ENDIF}
try
S.Position := 0;
CheckResult(Zip.AddStream(
'AddStreamData\SubFolder1\Subfolder2\Тестовый файл номер №3.txt', S));
finally
S.Free;
end;
// Теперь будут показаны пять вариантов добавления файлов
// физически присутствующих на диске
// Вариант первый:
// добавляем в архив содержимое папки "Create ZIP 2" вызовом
// базоовго метода AddFolder
if Zip.AddFolder('..\Create ZIP 2\') = 0 then
raise Exception.Create('Ошибка добавления данных');
// Вариант второй:
// добавляем содержимое нашей корневой директории в папку AddFolderDemo
// при помощи вызова расширенной функции AddFolder,
// в которой можем указать наименование папки внутри архива и указать
// необходимость добавления подпапок (третий параметр)
if Zip.AddFolder('AddFolderDemo', '..\..\', '*.pas', False) = 0 then
raise Exception.Create('Ошибка добавления данных');
// Вариант третий. Используем те-же файлы из корневой директории,
// Только добавлять будем руками при помощи метода AddFile
PresentFiles := TStringList.Create;
try
// Для начала их все найдем
if FindFirst(PathCanonicalize('..\..\*.pas'), faAnyFile, SR) = 0 then
try
repeat
if (SR.Name = '.') or (SR.Name = '..') then Continue;
if SR.Attr and faDirectory <> 0 then
Continue
else
PresentFiles.Add(SR.Name);
until FindNext(SR) <> 0;
finally
FindClose(SR);
end;
// Теперь добавим по одному,
// указывая в какой папке и под каким именем их размещать.
for I := 0 to PresentFiles.Count - 1 do
CheckResult(Zip.AddFile('..\..\' + PresentFiles[I],
'AddFile\' + PresentFiles[I]));
// Четвертый вариант - добавление списком при помощи метода AddFiles.
// Каждый элемент списка должен быть сформирован следующим образом:
// "Относительный путь и имя в архиве"="Путь к файлу"
// Т.е. ValueFromIndex указывает на путь к файлу,
// а Names - относительный путь в архиве
// Если не указать относительный путь, то будет браться только имя файла.
for I := 0 to PresentFiles.Count - 1 do
PresentFiles[I] :=
'AddFiles\' + PresentFiles[I] + '=..\..\' + PresentFiles[I];
if Zip.AddFiles(PresentFiles) <> PresentFiles.Count then
raise Exception.Create('Ошибка добавления данных');
finally
PresentFiles.Free;
end;
// И последний вариант, то-же добавление списком,
// только в данный список можно помещать папки. Метод AddFilesAndFolders.
// Файлы помещаются в список по тому-же принципу что и в методе AddFiles.
// Записи для папок формируются по принципу: "Относительный путь в архиве"="Путь к папке"
// Т.е. ValueFromIndex указывает на путь к папке,
// а Names - относительный путь в архиве от корня
// Здесь добавим все файлы и папки из корня проекта
PresentFiles := TStringList.Create;
try
if FindFirst(PathCanonicalize('..\..\*'), faAnyFile, SR) = 0 then
try
repeat
if (SR.Name = '.') or (SR.Name = '..') then Continue;
// пропускаем папку demos, т.к. там могут быть залоченные сейчас файлы
if AnsiLowerCase(SR.Name) = 'demos' then
Continue;
PresentFiles.Add('AddFilesAndFolders\' + SR.Name + '=..\..\' + SR.Name);
until FindNext(SR) <> 0;
finally
FindClose(SR);
end;
Zip.AddFilesAndFolders(PresentFiles, True);
finally
PresentFiles.Free;
end;
// Вот собственно и все - осталось создать сам архив...
BuildZipResult := Zip.BuildZip('..\DemoResults\CreateZIPDemo1.zip');
// ... и вывести результат
Writeln(GetEnumName(TypeInfo(TBuildZipResult), Integer(BuildZipResult)));
finally
Zip.Free;
end;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.

View File

@@ -0,0 +1,112 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{BDE6D9AD-8405-415D-A34C-F47E1BF78ED3}</ProjectGuid>
<MainSource>CreateZIPDemo1.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>19.2</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_E>false</DCC_E>
<DCC_F>false</DCC_F>
<DCC_K>false</DCC_K>
<DCC_N>false</DCC_N>
<DCC_S>false</DCC_S>
<DCC_ImageBase>00400000</DCC_ImageBase>
<SanitizedProjectName>CreateZIPDemo1</SanitizedProjectName>
<VerInfo_Locale>1049</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=</VerInfo_Keys>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<BT_BuildType>Debug</BT_BuildType>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_DebugInformation>0</DCC_DebugInformation>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<DCC_UnitSearchPath>../../;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<Manifest_File>(None)</Manifest_File>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">CreateZIPDemo1.dpr</Source>
</Source>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="CreateZIPDemo1"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="CreateZIPDemo1.dpr"/>
<IsPartOfProject Value="True"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<SearchPaths>
<IncludeFiles Value="..\..;$(ProjOutDir)"/>
<Libraries Value="..\..\fpc_lib"/>
<OtherUnitFiles Value="..\.."/>
<UnitOutputDirectory Value="."/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
</Linking>
<Other>
<CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,24 @@
rd /S /Q "%cd%\backup\"
rd /S /Q "%cd%\ConverterBackup\"
rd /S /Q "%cd%\lib\"
rd /S /Q "%cd%\__history\"
rd /S /Q "%cd%\__recovery\"
del "%cd%\*.o"
del "%cd%\*.a"
del "%cd%\*.or"
del "%cd%\*.lps"
del "%cd%\*.obj"
del "%cd%\*.exe"
del "%cd%\*.ppu"
del "%cd%\*.dcu"
del "%cd%\*.log"
del "%cd%\*.compiled"
del "%cd%\*.cfg"
del "%cd%\*.dof"
del "%cd%\*.dproj.local"
del "%cd%\*.identcache"
del "%cd%\*.dsk"
del "%cd%\*.skincfg"
del "%cd%\*.bak"
del "%cd%\*.rsm"
del "%cd%\*.~*"

View File

@@ -0,0 +1,84 @@
////////////////////////////////////////////////////////////////////////////////
//
// ****************************************************************************
// * Project : FWZip
// * Unit Name : CreateZIPDemo2
// * Purpose : Демонстрация изменения добавленных записей
// * Author : Александр (Rouse_) Багель
// * Copyright : © Fangorn Wizards Lab 1998 - 2023.
// * Version : 2.0.0
// * Home Page : http://rouse.drkb.ru
// * Home Blog : http://alexander-bagel.blogspot.ru
// ****************************************************************************
// * Stable Release : http://rouse.drkb.ru/components.php#fwzip
// * Latest Source : https://github.com/AlexanderBagel/FWZip
// ****************************************************************************
//
// Используемые источники:
// ftp://ftp.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
// https://zlib.net/zlib-1.2.13.tar.gz
// http://www.base2ti.com/
//
// Данный пример показывает различные варианты изменения записей
// в еще не сформированном архиве.
program CreateZIPDemo2;
{$IFDEF FPC}
{$MODE Delphi}
{$ELSE}
{$APPTYPE CONSOLE}
{$ENDIF}
uses
SysUtils,
TypInfo,
FWZipZLib,
FWZipWriter;
var
Zip: TFWZipWriter;
Item: TFWZipWriterItem;
I: Integer;
BuildZipResult: TBuildZipResult;
begin
SetCurrentDir(ExtractFilePath(ParamStr(0)));
try
Zip := TFWZipWriter.Create;
try
// Для начала добавим в корень архива файлы из корневой директории
Zip.AddFolder('..\..\', False);
// Теперь изменим им свойства:
for I := 0 to Zip.Count - 1 do
begin
Item := Zip[I];
// Изменим коментарий
Item.Comment := string('Тестовый коментарий к файлу ') + Item.FileName;
// Установим пароль
Item.Password := 'password';
// Изменим тип сжатия
Item.CompressionLevel := TCompressionLevel(Byte(I mod 3));
end;
// Теперь каждый элемент архива имеет коментарий, зашифрован паролем и
// имеет собственную степень сжатия в зависимости от своей
// порядковой позиции в архиве.
// Ну и сам архив так-же имеет коментарий.
Zip.Comment := 'Тестовый коментарий ко всему архиву';
// создаем архив и выводим результат
BuildZipResult := Zip.BuildZip('..\DemoResults\CreateZIPDemo2.zip');
// ... и вывести результат
Writeln(GetEnumName(TypeInfo(TBuildZipResult), Integer(BuildZipResult)));
finally
Zip.Free;
end;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.

View File

@@ -0,0 +1,152 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{15CDC38C-E807-44D8-BC70-FBEB85865A1B}</ProjectGuid>
<MainSource>CreateZIPDemo2.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>19.2</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_S>false</DCC_S>
<DCC_K>false</DCC_K>
<DCC_E>false</DCC_E>
<DCC_N>false</DCC_N>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=;CFBundleDisplayName=;UIDeviceFamily=;CFBundleIdentifier=;CFBundleVersion=;CFBundlePackageType=;CFBundleSignature=;CFBundleAllowMixedLocalizations=;UISupportedInterfaceOrientations=;CFBundleExecutable=;CFBundleResourceSpecification=;LSRequiresIPhoneOS=;CFBundleInfoDictionaryVersion=;CFBundleDevelopmentRegion=</VerInfo_Keys>
<DCC_F>false</DCC_F>
<VerInfo_Locale>1049</VerInfo_Locale>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<DCC_ImageBase>00400000</DCC_ImageBase>
<SanitizedProjectName>CreateZIPDemo2</SanitizedProjectName>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_DebugInformation>0</DCC_DebugInformation>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<DCC_UnitSearchPath>..\..\;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<Manifest_File>(None)</Manifest_File>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">CreateZIPDemo2.dpr</Source>
</Source>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1049</VersionInfo>
<VersionInfo Name="CodePage">1251</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
<VersionInfoKeys Name="CFBundleName"/>
<VersionInfoKeys Name="CFBundleDisplayName"/>
<VersionInfoKeys Name="UIDeviceFamily"/>
<VersionInfoKeys Name="CFBundleIdentifier"/>
<VersionInfoKeys Name="CFBundleVersion"/>
<VersionInfoKeys Name="CFBundlePackageType"/>
<VersionInfoKeys Name="CFBundleSignature"/>
<VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
<VersionInfoKeys Name="UISupportedInterfaceOrientations"/>
<VersionInfoKeys Name="CFBundleExecutable"/>
<VersionInfoKeys Name="CFBundleResourceSpecification"/>
<VersionInfoKeys Name="LSRequiresIPhoneOS"/>
<VersionInfoKeys Name="CFBundleInfoDictionaryVersion"/>
<VersionInfoKeys Name="CFBundleDevelopmentRegion"/>
</VersionInfoKeys>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="CreateZIPDemo2"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="CreateZIPDemo2.dpr"/>
<IsPartOfProject Value="True"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<SearchPaths>
<IncludeFiles Value="..\..;$(ProjOutDir)"/>
<Libraries Value="..\..\fpc_lib"/>
<OtherUnitFiles Value="..\.."/>
<UnitOutputDirectory Value="."/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
</Linking>
<Other>
<CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,24 @@
rd /S /Q "%cd%\backup\"
rd /S /Q "%cd%\ConverterBackup\"
rd /S /Q "%cd%\lib\"
rd /S /Q "%cd%\__history\"
rd /S /Q "%cd%\__recovery\"
del "%cd%\*.o"
del "%cd%\*.a"
del "%cd%\*.or"
del "%cd%\*.lps"
del "%cd%\*.obj"
del "%cd%\*.exe"
del "%cd%\*.ppu"
del "%cd%\*.dcu"
del "%cd%\*.log"
del "%cd%\*.compiled"
del "%cd%\*.cfg"
del "%cd%\*.dof"
del "%cd%\*.dproj.local"
del "%cd%\*.identcache"
del "%cd%\*.dsk"
del "%cd%\*.skincfg"
del "%cd%\*.bak"
del "%cd%\*.rsm"
del "%cd%\*.~*"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,107 @@
////////////////////////////////////////////////////////////////////////////////
//
// ****************************************************************************
// * Project : FWZip
// * Unit Name : ExctractZIPDemo1
// * Purpose : Демонстрация распаковки архива.
// * : Используется архив созданный демоприложением CreateZIPDemo1
// * Author : Александр (Rouse_) Багель
// * Copyright : © Fangorn Wizards Lab 1998 - 2023.
// * Version : 2.0.1
// * Home Page : http://rouse.drkb.ru
// * Home Blog : http://alexander-bagel.blogspot.ru
// ****************************************************************************
// * Stable Release : http://rouse.drkb.ru/components.php#fwzip
// * Latest Source : https://github.com/AlexanderBagel/FWZip
// ****************************************************************************
//
// Используемые источники:
// ftp://ftp.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
// https://zlib.net/zlib-1.2.13.tar.gz
// http://www.base2ti.com/
//
// Данный пример показывает два варианта извлечения информации из архива.
program ExctractZIPDemo1;
{$IFDEF FPC}
{$MODE Delphi}
{$H+}
{$ELSE}
{$APPTYPE CONSOLE}
{$ENDIF}
uses
Classes,
SysUtils,
TypInfo,
FWZipReader,
FWZipUtils;
function ExtractResultStr(Value: TExtractResult): string;
begin
Result := GetEnumName(TypeInfo(TExtractResult), Integer(Value));
end;
var
Zip: TFWZipReader;
Index: Integer;
M: TStringStream;
begin
SetCurrentDir(ExtractFilePath(ParamStr(0)));
try
Zip := TFWZipReader.Create;
try
// Открываем ранее созданный архив
Zip.LoadFromFile('..\DemoResults\CreateZIPDemo1.zip');
// Первый вариант распаковки - ручной доступ к каждому элементу архива
// В примере CreateZIPDemo1 мы создали в корне архива файл Test.txt
// Нам необходимо получить индекс этого элемента в архиве
Index := Zip.GetElementIndex('test.txt');
if Index >= 0 then
begin
// Распаковать можно в память:
M := TStringStream.Create('');
try
Zip[Index].ExtractToStream(M, '');
// Файл извлечен, выведем его содержимое в окно консоли
{$IFDEF UNICODE}
Writeln(M.DataString);
{$ELSE}
{$IFDEF FPC}
Writeln(M.DataString);
{$ELSE}
Writeln(ConvertToOemString(AnsiString(M.DataString)));
{$ENDIF}
{$ENDIF}
finally
M.Free;
end;
// Распаковать так-же можно на диск:
Write('Extract "', Zip[Index].FileName, '": ');
Writeln(ExtractResultStr(
Zip[Index].Extract('..\DemoResults\CreateZIPDemo1\ManualExtract\', '')));
end;
// Таким-же образом можно получить содержимое остальных файлов
// Второй вариант распаковки - автоматической распаковка архива
// в указанную папку на диске
Zip.ExtractAll('..\DemoResults\CreateZIPDemo1\');
// Третий вариант распаковки - автоматическая распаковка по маске
// (данный код распакует все файлы находящиеся в папке AddFolderDemo архива)
Zip.ExtractAll('AddFolderDemo*', '..\DemoResults\CreateZIPDemo1\ExtractMasked\');
finally
Zip.Free;
end;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.

View File

@@ -0,0 +1,868 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{B06883A2-58D3-4606-BFC2-63551788655E}</ProjectGuid>
<MainSource>ExctractZIPDemo1.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>19.2</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_S>false</DCC_S>
<DCC_K>false</DCC_K>
<DCC_E>false</DCC_E>
<DCC_N>false</DCC_N>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=;CFBundleDisplayName=;UIDeviceFamily=;CFBundleIdentifier=;CFBundleVersion=;CFBundlePackageType=;CFBundleSignature=;CFBundleAllowMixedLocalizations=;UISupportedInterfaceOrientations=;CFBundleExecutable=;CFBundleResourceSpecification=;LSRequiresIPhoneOS=;CFBundleInfoDictionaryVersion=;CFBundleDevelopmentRegion=</VerInfo_Keys>
<DCC_F>false</DCC_F>
<VerInfo_Locale>1049</VerInfo_Locale>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace)</DCC_Namespace>
<DCC_ImageBase>00400000</DCC_ImageBase>
<SanitizedProjectName>ExctractZIPDemo1</SanitizedProjectName>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_DebugInformation>0</DCC_DebugInformation>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<DCC_UnitSearchPath>..\..\;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<Manifest_File>(None)</Manifest_File>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">ExctractZIPDemo1.dpr</Source>
</Source>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1049</VersionInfo>
<VersionInfo Name="CodePage">1251</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
<VersionInfoKeys Name="CFBundleName"/>
<VersionInfoKeys Name="CFBundleDisplayName"/>
<VersionInfoKeys Name="UIDeviceFamily"/>
<VersionInfoKeys Name="CFBundleIdentifier"/>
<VersionInfoKeys Name="CFBundleVersion"/>
<VersionInfoKeys Name="CFBundlePackageType"/>
<VersionInfoKeys Name="CFBundleSignature"/>
<VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
<VersionInfoKeys Name="UISupportedInterfaceOrientations"/>
<VersionInfoKeys Name="CFBundleExecutable"/>
<VersionInfoKeys Name="CFBundleResourceSpecification"/>
<VersionInfoKeys Name="LSRequiresIPhoneOS"/>
<VersionInfoKeys Name="CFBundleInfoDictionaryVersion"/>
<VersionInfoKeys Name="CFBundleDevelopmentRegion"/>
</VersionInfoKeys>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
<Deployment Version="3">
<DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule">
<Platform Name="OSX32">
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule">
<Platform Name="iOSSimulator">
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libpcre.dylib" Class="DependencyModule">
<Platform Name="iOSSimulator">
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="ExctractZIPDemo1.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>ExctractZIPDemo1.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClassesDexFile">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidFileProvider">
<Platform Name="Android">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidGDBServer">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiFile">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiv7aFile">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeMipsFile">
<Platform Name="Android">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashImageDef">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStyles">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStylesV21">
<Platform Name="Android">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Colors">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_DefaultAppIcon">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon144">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon192">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon24">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage426">
<Platform Name="Android">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage470">
<Platform Name="Android">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage640">
<Platform Name="Android">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage960">
<Platform Name="Android">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Strings">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyFramework">
<Platform Name="OSX32">
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyModule">
<Platform Name="OSX32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="DependencyPackage">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.bpl</Extensions>
</Platform>
</DeployClass>
<DeployClass Name="File">
<Platform Name="Android">
<Operation>0</Operation>
</Platform>
<Platform Name="Android64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>0</Operation>
</Platform>
<Platform Name="OSX32">
<Operation>0</Operation>
</Platform>
<Platform Name="OSX64">
<Operation>0</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iOS_AppStore1024">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_AppIcon152">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_AppIcon167">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_LaunchDark2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Notification40">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Setting58">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_SpotLight80">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_AppIcon120">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_AppIcon180">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch3x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_LaunchDark2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_LaunchDark3x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Notification40">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Notification60">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Setting58">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Setting87">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Spotlight120">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Spotlight80">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectAndroidManifest">
<Platform Name="Android">
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSEntitlements"/>
<DeployClass Name="ProjectiOSInfoPList"/>
<DeployClass Name="ProjectiOSLaunchScreen"/>
<DeployClass Name="ProjectiOSResource">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXDebug"/>
<DeployClass Name="ProjectOSXEntitlements"/>
<DeployClass Name="ProjectOSXInfoPList"/>
<DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="Linux64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectUWPManifest">
<Platform Name="Win32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo150">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo44">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
</Deployment>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
<Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
</Project>

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="ExctractZIPDemo1"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="ExctractZIPDemo1.dpr"/>
<IsPartOfProject Value="True"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<SearchPaths>
<IncludeFiles Value="../..;$(ProjOutDir)"/>
<Libraries Value="../../fpc_lib"/>
<OtherUnitFiles Value="../.."/>
<UnitOutputDirectory Value="."/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
</Linking>
<Other>
<CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,24 @@
rd /S /Q "%cd%\backup\"
rd /S /Q "%cd%\ConverterBackup\"
rd /S /Q "%cd%\lib\"
rd /S /Q "%cd%\__history\"
rd /S /Q "%cd%\__recovery\"
del "%cd%\*.o"
del "%cd%\*.a"
del "%cd%\*.or"
del "%cd%\*.lps"
del "%cd%\*.obj"
del "%cd%\*.exe"
del "%cd%\*.ppu"
del "%cd%\*.dcu"
del "%cd%\*.log"
del "%cd%\*.compiled"
del "%cd%\*.cfg"
del "%cd%\*.dof"
del "%cd%\*.dproj.local"
del "%cd%\*.identcache"
del "%cd%\*.dsk"
del "%cd%\*.skincfg"
del "%cd%\*.bak"
del "%cd%\*.rsm"
del "%cd%\*.~*"

View File

@@ -0,0 +1,135 @@
////////////////////////////////////////////////////////////////////////////////
//
// ****************************************************************************
// * Project : FWZip
// * Unit Name : ExctractZIPDemo2
// * Purpose : Демонстрация распаковки зашифрованного архива.
// * Author : Александр (Rouse_) Багель
// * Copyright : © Fangorn Wizards Lab 1998 - 2023.
// * Version : 2.0.0
// * Home Page : http://rouse.drkb.ru
// * Home Blog : http://alexander-bagel.blogspot.ru
// ****************************************************************************
// * Stable Release : http://rouse.drkb.ru/components.php#fwzip
// * Latest Source : https://github.com/AlexanderBagel/FWZip
// ****************************************************************************
//
// Используемые источники:
// ftp://ftp.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
// https://zlib.net/zlib-1.2.13.tar.gz
// http://www.base2ti.com/
//
// Данный пример показывает создание и распаковку зашифрованного архива.
// Для демонстрации работы со списком паролей мы создадим архив,
// в котором каждому элементу назначим произвольный пароль из списка.
// При чем код излечения данных не будет знать какому файлу
// какой из паролей соответствует и есть ли пароль вообще.
program ExctractZIPDemo2;
{$IFDEF FPC}
{$MODE Delphi}
{$H+}
{$ELSE}
{$APPTYPE CONSOLE}
{$ENDIF}
uses
SysUtils,
FWZipWriter,
FWZipReader,
FWZipConsts;
const
PasswordList: array [0..3] of string = (
'', 'password1', 'password2', 'password3');
procedure OnPassword(Self, Sender: TObject; const FileName: string;
var Password: string; var CancelExtract: Boolean);
begin
{$IFDEF FPC}
// FPC ворнинги прописывает, просто чтобы не орала.
if (Self <> nil) and (FileName <> '') then
CancelExtract := False;
{$ENDIF}
Password := PasswordList[3];
end;
var
Writer: TFWZipWriter;
Reader: TFWZipReader;
Item: TFWZipWriterItem;
I: Integer;
ExtractResult: TExtractResult;
Method: TMethod;
begin
SetCurrentDir(ExtractFilePath(ParamStr(0)));
try
Writer := TFWZipWriter.Create;
try
// Для начала добавим в корень архива файлы из корневой директории
Writer.AddFolder('..\..\', False);
// Теперь назначим им пароли случайным образом
Randomize;
// У первого элемента пароль всегда будет присутствовать (для демонстрации)
Item := Writer[0];
Item.Password := PasswordList[Random(3) + 1];
Item.NeedDescriptor := True;
for I := 1 to Writer.Count - 1 do
begin
Item := Writer[I];
// Если используется шифрование желательно включать дескриптор файла
// см. Readme.txt
Item.NeedDescriptor := True;
Item.Password := PasswordList[Random(4)];
end;
// Сохраняем результат
Writer.BuildZip('..\DemoResults\ExctractZIPDemo2.zip');
finally
Writer.Free;
end;
Reader := TFWZipReader.Create;
try
Reader.LoadFromFile('..\DemoResults\ExctractZIPDemo2.zip');
// Теперь наша задача извлечь данные из архива
// В ручном режиме распаковки придется перебирать пароли самостоятельно
// Например вот так:
I := 0;
repeat
ExtractResult := Reader[0].Extract(
'..\DemoResults\ExctractZIPDemo2\ManualExtract\', PasswordList[I]);
Inc(I);
until ExtractResult <> erNeedPassword;
// Если предполагается использовать режим автоматической распаковки,
// то указать пароли можно двумя способами
// 1. через список паролей
Reader.PasswordList.Add(PasswordList[1]);
Reader.PasswordList.Add(PasswordList[2]);
// 2. через обработчик
Method.Code := @OnPassword;
Method.Data := Reader;
Reader.OnPassword := TZipNeedPasswordEvent(Method);
// для демонстрации в список паролей добавлены только два пароля
// третий будет передан через обработчик события OnPassword
Reader.ExtractAll('..\DemoResults\ExctractZIPDemo2\');
finally
Reader.Free;
end;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.

View File

@@ -0,0 +1,152 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{307D5F68-F671-4EF6-85EA-CF49C71350C7}</ProjectGuid>
<MainSource>ExctractZIPDemo2.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>19.2</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_S>false</DCC_S>
<DCC_K>false</DCC_K>
<DCC_E>false</DCC_E>
<DCC_N>false</DCC_N>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=;CFBundleDisplayName=;UIDeviceFamily=;CFBundleIdentifier=;CFBundleVersion=;CFBundlePackageType=;CFBundleSignature=;CFBundleAllowMixedLocalizations=;UISupportedInterfaceOrientations=;CFBundleExecutable=;CFBundleResourceSpecification=;LSRequiresIPhoneOS=;CFBundleInfoDictionaryVersion=;CFBundleDevelopmentRegion=</VerInfo_Keys>
<DCC_F>false</DCC_F>
<VerInfo_Locale>1049</VerInfo_Locale>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<DCC_ImageBase>00400000</DCC_ImageBase>
<SanitizedProjectName>ExctractZIPDemo2</SanitizedProjectName>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_DebugInformation>0</DCC_DebugInformation>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<DCC_UnitSearchPath>../../;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<Manifest_File>(None)</Manifest_File>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">ExctractZIPDemo2.dpr</Source>
</Source>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1049</VersionInfo>
<VersionInfo Name="CodePage">1251</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
<VersionInfoKeys Name="CFBundleName"/>
<VersionInfoKeys Name="CFBundleDisplayName"/>
<VersionInfoKeys Name="UIDeviceFamily"/>
<VersionInfoKeys Name="CFBundleIdentifier"/>
<VersionInfoKeys Name="CFBundleVersion"/>
<VersionInfoKeys Name="CFBundlePackageType"/>
<VersionInfoKeys Name="CFBundleSignature"/>
<VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
<VersionInfoKeys Name="UISupportedInterfaceOrientations"/>
<VersionInfoKeys Name="CFBundleExecutable"/>
<VersionInfoKeys Name="CFBundleResourceSpecification"/>
<VersionInfoKeys Name="LSRequiresIPhoneOS"/>
<VersionInfoKeys Name="CFBundleInfoDictionaryVersion"/>
<VersionInfoKeys Name="CFBundleDevelopmentRegion"/>
</VersionInfoKeys>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>

View File

@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="ExctractZIPDemo2"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="ExctractZIPDemo2.dpr"/>
<IsPartOfProject Value="True"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<SearchPaths>
<IncludeFiles Value="../..;$(ProjOutDir)"/>
<Libraries Value="../../fpc_lib"/>
<OtherUnitFiles Value="../.."/>
<UnitOutputDirectory Value="."/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
</Linking>
<Other>
<CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,24 @@
rd /S /Q "%cd%\backup\"
rd /S /Q "%cd%\ConverterBackup\"
rd /S /Q "%cd%\lib\"
rd /S /Q "%cd%\__history\"
rd /S /Q "%cd%\__recovery\"
del "%cd%\*.o"
del "%cd%\*.a"
del "%cd%\*.or"
del "%cd%\*.lps"
del "%cd%\*.obj"
del "%cd%\*.exe"
del "%cd%\*.ppu"
del "%cd%\*.dcu"
del "%cd%\*.log"
del "%cd%\*.compiled"
del "%cd%\*.cfg"
del "%cd%\*.dof"
del "%cd%\*.dproj.local"
del "%cd%\*.identcache"
del "%cd%\*.dsk"
del "%cd%\*.skincfg"
del "%cd%\*.bak"
del "%cd%\*.rsm"
del "%cd%\*.~*"

View File

@@ -0,0 +1,216 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{DEBDAF2E-104F-436D-8AFC-8BAC60505E64}</ProjectGuid>
</PropertyGroup>
<ItemGroup>
<Projects Include="Create ZIP 1\CreateZIPDemo1.dproj">
<Dependencies/>
</Projects>
<Projects Include="Create ZIP 2\CreateZIPDemo2.dproj">
<Dependencies/>
</Projects>
<Projects Include="Extract ZIP 1\ExctractZIPDemo1.dproj">
<Dependencies/>
</Projects>
<Projects Include="Extract ZIP 2\ExctractZIPDemo2.dproj">
<Dependencies/>
</Projects>
<Projects Include="PerfomanceTest\FWZipPerfomance.dproj">
<Dependencies/>
</Projects>
<Projects Include="Test Build With Exception\BuildWithException.dproj">
<Dependencies/>
</Projects>
<Projects Include="Use ZIP ExData\UseExDataBlob.dproj">
<Dependencies/>
</Projects>
<Projects Include="ZipAnalizer\ZipAnalizer.dproj">
<Dependencies/>
</Projects>
<Projects Include="ZipAnalizer2\ZipAnalizer2.dproj">
<Dependencies/>
</Projects>
<Projects Include="Modify ZIP\Split ZIP\SplitZip.dproj">
<Dependencies/>
</Projects>
<Projects Include="Modify ZIP\Merge two ZIP\MergeZip.dproj">
<Dependencies/>
</Projects>
<Projects Include="Modify ZIP\Replace data in ZIP\ReplaceZipItemData.dproj">
<Dependencies/>
</Projects>
<Projects Include="..\.UnitTest\FWZipUnitTest.dproj">
<Dependencies/>
</Projects>
<Projects Include="MultyPart ZIP\Create MultiPart ZIP\CreateMultiPartZip.dproj">
<Dependencies/>
</Projects>
<Projects Include="MultyPart ZIP\Modify MultiPart Zip\ModifyMultiPartZip.dproj">
<Dependencies/>
</Projects>
<Projects Include="MultyPart ZIP\Read MultiPart ZIP\ReadMultiPartZip.dproj">
<Dependencies/>
</Projects>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Default.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Default.Personality/>
</BorlandProject>
</ProjectExtensions>
<Target Name="CreateZIPDemo1">
<MSBuild Projects="Create ZIP 1\CreateZIPDemo1.dproj"/>
</Target>
<Target Name="CreateZIPDemo1:Clean">
<MSBuild Projects="Create ZIP 1\CreateZIPDemo1.dproj" Targets="Clean"/>
</Target>
<Target Name="CreateZIPDemo1:Make">
<MSBuild Projects="Create ZIP 1\CreateZIPDemo1.dproj" Targets="Make"/>
</Target>
<Target Name="CreateZIPDemo2">
<MSBuild Projects="Create ZIP 2\CreateZIPDemo2.dproj"/>
</Target>
<Target Name="CreateZIPDemo2:Clean">
<MSBuild Projects="Create ZIP 2\CreateZIPDemo2.dproj" Targets="Clean"/>
</Target>
<Target Name="CreateZIPDemo2:Make">
<MSBuild Projects="Create ZIP 2\CreateZIPDemo2.dproj" Targets="Make"/>
</Target>
<Target Name="ExctractZIPDemo1">
<MSBuild Projects="Extract ZIP 1\ExctractZIPDemo1.dproj"/>
</Target>
<Target Name="ExctractZIPDemo1:Clean">
<MSBuild Projects="Extract ZIP 1\ExctractZIPDemo1.dproj" Targets="Clean"/>
</Target>
<Target Name="ExctractZIPDemo1:Make">
<MSBuild Projects="Extract ZIP 1\ExctractZIPDemo1.dproj" Targets="Make"/>
</Target>
<Target Name="ExctractZIPDemo2">
<MSBuild Projects="Extract ZIP 2\ExctractZIPDemo2.dproj"/>
</Target>
<Target Name="ExctractZIPDemo2:Clean">
<MSBuild Projects="Extract ZIP 2\ExctractZIPDemo2.dproj" Targets="Clean"/>
</Target>
<Target Name="ExctractZIPDemo2:Make">
<MSBuild Projects="Extract ZIP 2\ExctractZIPDemo2.dproj" Targets="Make"/>
</Target>
<Target Name="FWZipPerfomance">
<MSBuild Projects="PerfomanceTest\FWZipPerfomance.dproj"/>
</Target>
<Target Name="FWZipPerfomance:Clean">
<MSBuild Projects="PerfomanceTest\FWZipPerfomance.dproj" Targets="Clean"/>
</Target>
<Target Name="FWZipPerfomance:Make">
<MSBuild Projects="PerfomanceTest\FWZipPerfomance.dproj" Targets="Make"/>
</Target>
<Target Name="BuildWithException">
<MSBuild Projects="Test Build With Exception\BuildWithException.dproj"/>
</Target>
<Target Name="BuildWithException:Clean">
<MSBuild Projects="Test Build With Exception\BuildWithException.dproj" Targets="Clean"/>
</Target>
<Target Name="BuildWithException:Make">
<MSBuild Projects="Test Build With Exception\BuildWithException.dproj" Targets="Make"/>
</Target>
<Target Name="UseExDataBlob">
<MSBuild Projects="Use ZIP ExData\UseExDataBlob.dproj"/>
</Target>
<Target Name="UseExDataBlob:Clean">
<MSBuild Projects="Use ZIP ExData\UseExDataBlob.dproj" Targets="Clean"/>
</Target>
<Target Name="UseExDataBlob:Make">
<MSBuild Projects="Use ZIP ExData\UseExDataBlob.dproj" Targets="Make"/>
</Target>
<Target Name="ZipAnalizer">
<MSBuild Projects="ZipAnalizer\ZipAnalizer.dproj"/>
</Target>
<Target Name="ZipAnalizer:Clean">
<MSBuild Projects="ZipAnalizer\ZipAnalizer.dproj" Targets="Clean"/>
</Target>
<Target Name="ZipAnalizer:Make">
<MSBuild Projects="ZipAnalizer\ZipAnalizer.dproj" Targets="Make"/>
</Target>
<Target Name="ZipAnalizer2">
<MSBuild Projects="ZipAnalizer2\ZipAnalizer2.dproj"/>
</Target>
<Target Name="ZipAnalizer2:Clean">
<MSBuild Projects="ZipAnalizer2\ZipAnalizer2.dproj" Targets="Clean"/>
</Target>
<Target Name="ZipAnalizer2:Make">
<MSBuild Projects="ZipAnalizer2\ZipAnalizer2.dproj" Targets="Make"/>
</Target>
<Target Name="SplitZip">
<MSBuild Projects="Modify ZIP\Split ZIP\SplitZip.dproj"/>
</Target>
<Target Name="SplitZip:Clean">
<MSBuild Projects="Modify ZIP\Split ZIP\SplitZip.dproj" Targets="Clean"/>
</Target>
<Target Name="SplitZip:Make">
<MSBuild Projects="Modify ZIP\Split ZIP\SplitZip.dproj" Targets="Make"/>
</Target>
<Target Name="MergeZip">
<MSBuild Projects="Modify ZIP\Merge two ZIP\MergeZip.dproj"/>
</Target>
<Target Name="MergeZip:Clean">
<MSBuild Projects="Modify ZIP\Merge two ZIP\MergeZip.dproj" Targets="Clean"/>
</Target>
<Target Name="MergeZip:Make">
<MSBuild Projects="Modify ZIP\Merge two ZIP\MergeZip.dproj" Targets="Make"/>
</Target>
<Target Name="ReplaceZipItemData">
<MSBuild Projects="Modify ZIP\Replace data in ZIP\ReplaceZipItemData.dproj"/>
</Target>
<Target Name="ReplaceZipItemData:Clean">
<MSBuild Projects="Modify ZIP\Replace data in ZIP\ReplaceZipItemData.dproj" Targets="Clean"/>
</Target>
<Target Name="ReplaceZipItemData:Make">
<MSBuild Projects="Modify ZIP\Replace data in ZIP\ReplaceZipItemData.dproj" Targets="Make"/>
</Target>
<Target Name="FWZipUnitTest">
<MSBuild Projects="..\.UnitTest\FWZipUnitTest.dproj"/>
</Target>
<Target Name="FWZipUnitTest:Clean">
<MSBuild Projects="..\.UnitTest\FWZipUnitTest.dproj" Targets="Clean"/>
</Target>
<Target Name="FWZipUnitTest:Make">
<MSBuild Projects="..\.UnitTest\FWZipUnitTest.dproj" Targets="Make"/>
</Target>
<Target Name="CreateMultiPartZip">
<MSBuild Projects="MultyPart ZIP\Create MultiPart ZIP\CreateMultiPartZip.dproj"/>
</Target>
<Target Name="CreateMultiPartZip:Clean">
<MSBuild Projects="MultyPart ZIP\Create MultiPart ZIP\CreateMultiPartZip.dproj" Targets="Clean"/>
</Target>
<Target Name="CreateMultiPartZip:Make">
<MSBuild Projects="MultyPart ZIP\Create MultiPart ZIP\CreateMultiPartZip.dproj" Targets="Make"/>
</Target>
<Target Name="ModifyMultiPartZip">
<MSBuild Projects="MultyPart ZIP\Modify MultiPart Zip\ModifyMultiPartZip.dproj"/>
</Target>
<Target Name="ModifyMultiPartZip:Clean">
<MSBuild Projects="MultyPart ZIP\Modify MultiPart Zip\ModifyMultiPartZip.dproj" Targets="Clean"/>
</Target>
<Target Name="ModifyMultiPartZip:Make">
<MSBuild Projects="MultyPart ZIP\Modify MultiPart Zip\ModifyMultiPartZip.dproj" Targets="Make"/>
</Target>
<Target Name="ReadMultiPartZip">
<MSBuild Projects="MultyPart ZIP\Read MultiPart ZIP\ReadMultiPartZip.dproj"/>
</Target>
<Target Name="ReadMultiPartZip:Clean">
<MSBuild Projects="MultyPart ZIP\Read MultiPart ZIP\ReadMultiPartZip.dproj" Targets="Clean"/>
</Target>
<Target Name="ReadMultiPartZip:Make">
<MSBuild Projects="MultyPart ZIP\Read MultiPart ZIP\ReadMultiPartZip.dproj" Targets="Make"/>
</Target>
<Target Name="Build">
<CallTarget Targets="CreateZIPDemo1;CreateZIPDemo2;ExctractZIPDemo1;ExctractZIPDemo2;FWZipPerfomance;BuildWithException;UseExDataBlob;ZipAnalizer;ZipAnalizer2;SplitZip;MergeZip;ReplaceZipItemData;FWZipUnitTest;CreateMultiPartZip;ModifyMultiPartZip;ReadMultiPartZip"/>
</Target>
<Target Name="Clean">
<CallTarget Targets="CreateZIPDemo1:Clean;CreateZIPDemo2:Clean;ExctractZIPDemo1:Clean;ExctractZIPDemo2:Clean;FWZipPerfomance:Clean;BuildWithException:Clean;UseExDataBlob:Clean;ZipAnalizer:Clean;ZipAnalizer2:Clean;SplitZip:Clean;MergeZip:Clean;ReplaceZipItemData:Clean;FWZipUnitTest:Clean;CreateMultiPartZip:Clean;ModifyMultiPartZip:Clean;ReadMultiPartZip:Clean"/>
</Target>
<Target Name="Make">
<CallTarget Targets="CreateZIPDemo1:Make;CreateZIPDemo2:Make;ExctractZIPDemo1:Make;ExctractZIPDemo2:Make;FWZipPerfomance:Make;BuildWithException:Make;UseExDataBlob:Make;ZipAnalizer:Make;ZipAnalizer2:Make;SplitZip:Make;MergeZip:Make;ReplaceZipItemData:Make;FWZipUnitTest:Make;CreateMultiPartZip:Make;ModifyMultiPartZip:Make;ReadMultiPartZip:Make"/>
</Target>
<Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/>
</Project>

View File

@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectGroup FileVersion="2">
<Targets>
<Target FileName="Create ZIP 1\CreateZIPDemo1.lpi">
<BuildModes>
<Mode Name="Default"/>
</BuildModes>
</Target>
<Target FileName="Create ZIP 2\CreateZIPDemo2.lpi">
<BuildModes>
<Mode Name="Default"/>
</BuildModes>
</Target>
<Target FileName="Extract ZIP 1\ExctractZIPDemo1.lpi">
<BuildModes>
<Mode Name="Default"/>
</BuildModes>
</Target>
<Target FileName="Extract ZIP 2\ExctractZIPDemo2.lpi">
<BuildModes>
<Mode Name="Default"/>
</BuildModes>
</Target>
<Target FileName="Modify ZIP\Split ZIP\SplitZip.lpi">
<BuildModes>
<Mode Name="Default"/>
</BuildModes>
</Target>
<Target FileName="Modify ZIP\Merge two ZIP\MergeZip.lpi">
<BuildModes>
<Mode Name="Default"/>
</BuildModes>
</Target>
<Target FileName="Modify ZIP\Replace data in ZIP\ReplaceZipItemData.lpi">
<BuildModes>
<Mode Name="Default"/>
</BuildModes>
</Target>
<Target FileName="MultyPart ZIP\Create MultiPart ZIP\CreateMultiPartZip.lpi">
<BuildModes>
<Mode Name="Default"/>
</BuildModes>
</Target>
<Target FileName="MultyPart ZIP\Read MultiPart ZIP\ReadMultiPartZip.lpi">
<BuildModes>
<Mode Name="Default"/>
</BuildModes>
</Target>
<Target FileName="MultyPart ZIP\Modify MultiPart ZIP\ModifyMultiPartZip.lpi">
<BuildModes>
<Mode Name="Default"/>
</BuildModes>
</Target>
<Target FileName="PerfomanceTest\FWZipPerfomance.lpi">
<BuildModes>
<Mode Name="Default"/>
</BuildModes>
</Target>
<Target FileName="Test Build With Exception\BuildWithException.lpi">
<BuildModes>
<Mode Name="Default"/>
</BuildModes>
</Target>
<Target FileName="Use ZIP ExData\UseExDataBlob.lpi">
<BuildModes>
<Mode Name="Default"/>
</BuildModes>
</Target>
<Target FileName="ZipAnalizer\ZipAnalizer.lpi">
<BuildModes>
<Mode Name="Default"/>
</BuildModes>
</Target>
<Target FileName="ZipAnalizer2\ZipAnalizer2.lpi">
<BuildModes>
<Mode Name="Default"/>
</BuildModes>
</Target>
</Targets>
</ProjectGroup>
</CONFIG>

View File

@@ -0,0 +1,71 @@
////////////////////////////////////////////////////////////////////////////////
//
// ****************************************************************************
// * Project : FWZip
// * Unit Name : MergeZip
// * Purpose : Демонстрация обьединения нескольких архивов
// * Author : Александр (Rouse_) Багель
// * Copyright : © Fangorn Wizards Lab 1998 - 2023.
// * Version : 2.0.0
// * Home Page : http://rouse.drkb.ru
// * Home Blog : http://alexander-bagel.blogspot.ru
// ****************************************************************************
// * Stable Release : http://rouse.drkb.ru/components.php#fwzip
// * Latest Source : https://github.com/AlexanderBagel/FWZip
// ****************************************************************************
//
// Используемые источники:
// ftp://ftp.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
// https://zlib.net/zlib-1.2.13.tar.gz
// http://www.base2ti.com/
//
// Данный пример показывает как можно обьединить несколько
// ранее созданных архивов в один,
// без необходимости распаковки данных и повторного сжатия.
program MergeZip;
{$IFDEF FPC}
{$MODE Delphi}
{$H+}
{$ELSE}
{$APPTYPE CONSOLE}
{$ENDIF}
uses
SysUtils,
FWZipModifier;
var
Modifier: TFWZipModifier;
Index1, Index2: TReaderIndex;
begin
SetCurrentDir(ExtractFilePath(ParamStr(0)));
try
// создаем экземпляр модификатора архивов
Modifier := TFWZipModifier.Create;
try
// подключаем первый архив, который был создан в примере SplitZip
Index1 := Modifier.AddZipFile('..\..\DemoResults\splited_archive1.zip');
// подключаем второй архив
Index2 := Modifier.AddZipFile('..\..\DemoResults\splited_archive2.zip');
// добавляем все элементы из первого архива
Modifier.AddFromZip(Index1);
// и из второго
Modifier.AddFromZip(Index2);
// теперь создаем новый архив который будет включать в себя все элементы обоих архивов
// и технически будет идентичен архиву split_main_archive.zip, который
// был создан в примере SplitZip (оба архива будут совпадать вплоть до контрольной суммы)
Modifier.BuildZip('..\..\DemoResults\merged_archive.zip')
finally
Modifier.Free;
end;
// пример изменения данных, не трогая остальные элементы архива
// можно увидеть в примере ReplaceZipItemData
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.

View File

@@ -0,0 +1,152 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{0C461837-3166-43B0-98D4-CEA909363C55}</ProjectGuid>
<MainSource>MergeZip.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>19.2</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_K>false</DCC_K>
<DCC_ImageBase>00400000</DCC_ImageBase>
<DCC_F>false</DCC_F>
<VerInfo_Locale>1049</VerInfo_Locale>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<DCC_S>false</DCC_S>
<DCC_N>false</DCC_N>
<DCC_E>false</DCC_E>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=;CFBundleDisplayName=;UIDeviceFamily=;CFBundleIdentifier=;CFBundleVersion=;CFBundlePackageType=;CFBundleSignature=;CFBundleAllowMixedLocalizations=;UISupportedInterfaceOrientations=;CFBundleExecutable=;CFBundleResourceSpecification=;LSRequiresIPhoneOS=;CFBundleInfoDictionaryVersion=;CFBundleDevelopmentRegion=</VerInfo_Keys>
<SanitizedProjectName>MergeZip</SanitizedProjectName>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_DebugInformation>0</DCC_DebugInformation>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<DCC_UnitSearchPath>../../../;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<Manifest_File>(None)</Manifest_File>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">MergeZip.dpr</Source>
</Source>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1049</VersionInfo>
<VersionInfo Name="CodePage">1251</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
<VersionInfoKeys Name="CFBundleName"/>
<VersionInfoKeys Name="CFBundleDisplayName"/>
<VersionInfoKeys Name="UIDeviceFamily"/>
<VersionInfoKeys Name="CFBundleIdentifier"/>
<VersionInfoKeys Name="CFBundleVersion"/>
<VersionInfoKeys Name="CFBundlePackageType"/>
<VersionInfoKeys Name="CFBundleSignature"/>
<VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
<VersionInfoKeys Name="UISupportedInterfaceOrientations"/>
<VersionInfoKeys Name="CFBundleExecutable"/>
<VersionInfoKeys Name="CFBundleResourceSpecification"/>
<VersionInfoKeys Name="LSRequiresIPhoneOS"/>
<VersionInfoKeys Name="CFBundleInfoDictionaryVersion"/>
<VersionInfoKeys Name="CFBundleDevelopmentRegion"/>
</VersionInfoKeys>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>

View File

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="MergeZip"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="MergeZip.dpr"/>
<IsPartOfProject Value="True"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="..\..\..;$(ProjOutDir)"/>
<Libraries Value="..\..\..\fpc_lib"/>
<OtherUnitFiles Value="..\..\.."/>
<UnitOutputDirectory Value="."/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
</Linking>
<Other>
<CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,24 @@
rd /S /Q "%cd%\backup\"
rd /S /Q "%cd%\ConverterBackup\"
rd /S /Q "%cd%\lib\"
rd /S /Q "%cd%\__history\"
rd /S /Q "%cd%\__recovery\"
del "%cd%\*.o"
del "%cd%\*.a"
del "%cd%\*.or"
del "%cd%\*.lps"
del "%cd%\*.obj"
del "%cd%\*.exe"
del "%cd%\*.ppu"
del "%cd%\*.dcu"
del "%cd%\*.log"
del "%cd%\*.compiled"
del "%cd%\*.cfg"
del "%cd%\*.dof"
del "%cd%\*.dproj.local"
del "%cd%\*.identcache"
del "%cd%\*.dsk"
del "%cd%\*.skincfg"
del "%cd%\*.bak"
del "%cd%\*.rsm"
del "%cd%\*.~*"

View File

@@ -0,0 +1,196 @@
////////////////////////////////////////////////////////////////////////////////
//
// ****************************************************************************
// * Project : FWZip
// * Unit Name : ReplaceZipItemData
// * Purpose : Демонстрация изменения данных в уже созданном архиве
// * Author : Александр (Rouse_) Багель
// * Copyright : © Fangorn Wizards Lab 1998 - 2023.
// * Version : 2.0.2
// * Home Page : http://rouse.drkb.ru
// * Home Blog : http://alexander-bagel.blogspot.ru
// ****************************************************************************
// * Stable Release : http://rouse.drkb.ru/components.php#fwzip
// * Latest Source : https://github.com/AlexanderBagel/FWZip
// ****************************************************************************
//
// Используемые источники:
// ftp://ftp.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
// https://zlib.net/zlib-1.2.13.tar.gz
// http://www.base2ti.com/
// http://www.base2ti.com/
//
// Данный пример показывает как можно изменить данные в уже созданном архиве
// без необходимости распаковки неизмененных элементов и их повторного сжатия.
program ReplaceZipItemData;
{$IFDEF FPC}
{$MODE Delphi}
{$H+}
{$ELSE}
{$APPTYPE CONSOLE}
{$ENDIF}
uses
SysUtils,
Classes,
FWZipReader,
FWZipModifier;
var
Modifier: TFWZipModifier;
Reader: TFWZipReader;
Index: TReaderIndex;
S: TStringStream;
I: Integer;
begin
SetCurrentDir(ExtractFilePath(ParamStr(0)));
try
// создаем экземпляр модификатора архивов
Modifier := TFWZipModifier.Create;
try
// подключаем ранее созданный архив
Index := Modifier.AddZipFile('..\..\DemoResults\split_main_archive.zip');
// добавляем из него первый элемент указывая его имя
Modifier.AddFromZip(Index, 'test1.txt');
// добавляем второй элемент, взяв имя из внутреннего ридера
Modifier.AddFromZip(Index, Modifier.Reader[Index].Item[1].FileName);
// вместо третьего пишем новые данные
S := TStringStream.Create('новые данные для третьего элемента архива');
try
S.Position := 0;
Modifier.AddStream('test3.txt', S);
finally
S.Free;
end;
// ну и добавляем последний элемент с одновременным изменением имени
Modifier.AddFromZip(Index, 'test4.txt', 'New test4.txt');
// теперь делаем новый архив,
// при этом данные от первого второго и четвертого элемента
// скопируются как есть без распаковки,
// а вместо третьего элемента будет добавлен новый блок данных
Modifier.BuildZip('..\..\DemoResults\replaced_data_archive1.zip');
finally
Modifier.Free;
end;
// предыдущий вариант был с сохранением порядка элемента в архиве
// если же порядок не важен, то можно сделать еще проще:
// создаем экземпляр модификатора архивов
Modifier := TFWZipModifier.Create;
try
// подключаем ранее созданный архив
Index := Modifier.AddZipFile('..\..\DemoResults\split_main_archive.zip');
// добавляем все элементы
Modifier.AddFromZip(Index);
// теперь удалим запись о третьем элементе
Modifier.DeleteItem(2);
// и пишем новые данные
S := TStringStream.Create('новые данные для третьего элемента архива');
try
S.Position := 0;
Modifier.AddStream('test3.txt', S);
finally
S.Free;
end;
// теперь делаем новый архив, принцип тот же самый
Modifier.BuildZip('..\..\DemoResults\replaced_data_archive2.zip');
finally
Modifier.Free;
end;
// третий вариант с передачей ридера снаружи, причем время жизни ридера
// контролирем мы сами
// Содаем ридер который будем использовать не только для модификации
// но и для каких-то своих задач
Reader := TFWZipReader.Create;
try
// читаем данные из ранее созданного тестового архива
Reader.LoadFromFile('..\..\DemoResults\split_main_archive.zip');
// создаем экземпляр модификатора архивов
Modifier := TFWZipModifier.Create;
try
// подключаем архив через доступный нам ридер
Index := Modifier.AddZipFile(Reader);
// добавляем из него все элементы кроме последнего
for I := 0 to Modifier.Reader[Index].Count - 2 do
Modifier.AddFromZip(Index, Modifier.Reader[Index].Item[I].FileName);
// вместо последнего пишем новые данные
S := TStringStream.Create('новые данные для последнего элемента архива');
try
S.Position := 0;
Modifier.AddStream('test4.txt', S);
finally
S.Free;
end;
// и ребилдим архив
Modifier.BuildZip('..\..\DemoResults\replaced_data_archive3.zip');
finally
Modifier.Free;
end;
finally
Reader.Free;
end;
// четвертый вариант, это небольшая модификация епрвого варианта,
// только подключение архива происходит так-же как и в третьем через ридер
// но в этот раз время жизни ридера будет контролировать модификатор
// создаем экземпляр модификатора архивов
Modifier := TFWZipModifier.Create;
try
// создаем экземпляр ридера
Reader := TFWZipReader.Create;
// открываем ранее созданный архив
Reader.LoadFromFile('..\..\DemoResults\split_main_archive.zip');
// и подкючаем его к модификатору указывая вторым параметром,
// что разрушать ридер должен модификатор
Index := Modifier.AddZipFile(Reader, roOwned);
// добавляем из него первый элемент указывая его имя
Modifier.AddFromZip(Index, 'test1.txt');
// добавляем второй элемент, взяв имя из внутреннего ридера
Modifier.AddFromZip(Index, Modifier.Reader[Index].Item[1].FileName);
// вместо третьего пишем новые данные
S := TStringStream.Create('новые данные для третьего элемента архива');
try
S.Position := 0;
Modifier.AddStream('test3.txt', S);
finally
S.Free;
end;
// ну и добавляем последний элемент
Modifier.AddFromZip(Index, 'test4.txt');
// теперь делаем новый архив,
// при этом данные от первого второго и четвертого элемента
// скопируются как есть без распаковки,
// а вместо третьего элемента будет добавлен новый блок данных
Modifier.BuildZip('..\..\DemoResults\replaced_data_archive4.zip');
finally
Modifier.Free;
end;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.

View File

@@ -0,0 +1,152 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{8453DFA8-0B2E-4EEF-AC75-7BBE052C1943}</ProjectGuid>
<MainSource>ReplaceZipItemData.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>19.2</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_K>false</DCC_K>
<DCC_ImageBase>00400000</DCC_ImageBase>
<DCC_F>false</DCC_F>
<VerInfo_Locale>1049</VerInfo_Locale>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<DCC_S>false</DCC_S>
<DCC_N>false</DCC_N>
<DCC_E>false</DCC_E>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=;CFBundleDisplayName=;UIDeviceFamily=;CFBundleIdentifier=;CFBundleVersion=;CFBundlePackageType=;CFBundleSignature=;CFBundleAllowMixedLocalizations=;UISupportedInterfaceOrientations=;CFBundleExecutable=;CFBundleResourceSpecification=;LSRequiresIPhoneOS=;CFBundleInfoDictionaryVersion=;CFBundleDevelopmentRegion=</VerInfo_Keys>
<SanitizedProjectName>ReplaceZipItemData</SanitizedProjectName>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_DebugInformation>0</DCC_DebugInformation>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<DCC_UnitSearchPath>../../../;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<Manifest_File>(None)</Manifest_File>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">ReplaceZipItemData.dpr</Source>
</Source>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1049</VersionInfo>
<VersionInfo Name="CodePage">1251</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
<VersionInfoKeys Name="CFBundleName"/>
<VersionInfoKeys Name="CFBundleDisplayName"/>
<VersionInfoKeys Name="UIDeviceFamily"/>
<VersionInfoKeys Name="CFBundleIdentifier"/>
<VersionInfoKeys Name="CFBundleVersion"/>
<VersionInfoKeys Name="CFBundlePackageType"/>
<VersionInfoKeys Name="CFBundleSignature"/>
<VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
<VersionInfoKeys Name="UISupportedInterfaceOrientations"/>
<VersionInfoKeys Name="CFBundleExecutable"/>
<VersionInfoKeys Name="CFBundleResourceSpecification"/>
<VersionInfoKeys Name="LSRequiresIPhoneOS"/>
<VersionInfoKeys Name="CFBundleInfoDictionaryVersion"/>
<VersionInfoKeys Name="CFBundleDevelopmentRegion"/>
</VersionInfoKeys>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>

View File

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="ReplaceZipItemData"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="ReplaceZipItemData.dpr"/>
<IsPartOfProject Value="True"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="..\..\..;$(ProjOutDir)"/>
<Libraries Value="..\..\..\fpc_lib"/>
<OtherUnitFiles Value="..\..\.."/>
<UnitOutputDirectory Value="."/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
</Linking>
<Other>
<CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,24 @@
rd /S /Q "%cd%\backup\"
rd /S /Q "%cd%\ConverterBackup\"
rd /S /Q "%cd%\lib\"
rd /S /Q "%cd%\__history\"
rd /S /Q "%cd%\__recovery\"
del "%cd%\*.o"
del "%cd%\*.a"
del "%cd%\*.or"
del "%cd%\*.lps"
del "%cd%\*.obj"
del "%cd%\*.exe"
del "%cd%\*.ppu"
del "%cd%\*.dcu"
del "%cd%\*.log"
del "%cd%\*.compiled"
del "%cd%\*.cfg"
del "%cd%\*.dof"
del "%cd%\*.dproj.local"
del "%cd%\*.identcache"
del "%cd%\*.dsk"
del "%cd%\*.skincfg"
del "%cd%\*.bak"
del "%cd%\*.rsm"
del "%cd%\*.~*"

View File

@@ -0,0 +1,106 @@
////////////////////////////////////////////////////////////////////////////////
//
// ****************************************************************************
// * Project : FWZip
// * Unit Name : SplitZip
// * Purpose : Демонстрация работы c разбитием архива
// * Author : Александр (Rouse_) Багель
// * Copyright : © Fangorn Wizards Lab 1998 - 2023.
// * Version : 2.0.0
// * Home Page : http://rouse.drkb.ru
// * Home Blog : http://alexander-bagel.blogspot.ru
// ****************************************************************************
// * Stable Release : http://rouse.drkb.ru/components.php#fwzip
// * Latest Source : https://github.com/AlexanderBagel/FWZip
// ****************************************************************************
//
// Используемые источники:
// ftp://ftp.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
// https://zlib.net/zlib-1.2.13.tar.gz
// http://www.base2ti.com/
//
// Данный пример показывает как можно разделить архив на несколько частей,
// без необходимости распаковки данных и повторного сжатия.
program SplitZip;
{$IFDEF FPC}
{$MODE Delphi}
{$H+}
{$ELSE}
{$APPTYPE CONSOLE}
{$ENDIF}
uses
SysUtils,
Classes,
FWZipWriter,
FWZipModifier;
procedure AddItem(AWriter: TFWZipWriter; const AName, AData: string);
var
S: TStringStream;
begin
S := TStringStream.Create(AData);
try
S.Position := 0;
AWriter.AddStream(AName, S);
finally
S.Free;
end;
end;
var
Writer: TFWZipWriter;
Modifier: TFWZipModifier;
Index: TReaderIndex;
begin
SetCurrentDir(ExtractFilePath(ParamStr(0)));
try
// создаем архив который будем разделять
Writer := TFWZipWriter.Create;
try
// добавляем 4 элемента в архив
AddItem(Writer, 'test1.txt', 'первый элемент');
AddItem(Writer, 'test2.txt', 'второй элемент');
AddItem(Writer, 'test3.txt', 'третий элемент');
AddItem(Writer, 'test4.txt', 'четвертый элемент');
// сохраняем
Writer.BuildZip('..\..\DemoResults\split_main_archive.zip');
finally
Writer.Free;
end;
// создаем экземпляр модификатора архивов
Modifier := TFWZipModifier.Create;
try
// подключаем ранее созданный архив
Index := Modifier.AddZipFile('..\..\DemoResults\split_main_archive.zip');
// добавляем из него первые два элемента
Modifier.AddFromZip(Index, 'test1.txt');
Modifier.AddFromZip(Index, 'test2.txt');
// и сохраняем в новый архив
// при этом реальной перепаковки данных не произойдет,
// данные возьмутся как есть в виде массива байт прямо в сжатом виде
// из оригинального архива
Modifier.BuildZip('..\..\DemoResults\splited_archive1.zip');
// теперь удаляем добавленные элементы и добавляем вторые два
Modifier.Clear;
Modifier.AddFromZip(Index, 'test3.txt');
Modifier.AddFromZip(Index, 'test4.txt');
// сохраняем во торой архив
Modifier.BuildZip('..\..\DemoResults\splited_archive2.zip');
finally
Modifier.Free;
end;
// вот и все, мы разделили изначальный архив на две части
// не занимаясь перепаковкой данных
// как обьединять смотрите в примере MergeZip
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.

View File

@@ -0,0 +1,152 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{CEAA2516-64BD-4590-AA4E-B25AFD2A0DF3}</ProjectGuid>
<MainSource>SplitZip.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>19.2</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_K>false</DCC_K>
<DCC_ImageBase>00400000</DCC_ImageBase>
<DCC_F>false</DCC_F>
<VerInfo_Locale>1049</VerInfo_Locale>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<DCC_S>false</DCC_S>
<DCC_N>false</DCC_N>
<DCC_E>false</DCC_E>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=;CFBundleDisplayName=;UIDeviceFamily=;CFBundleIdentifier=;CFBundleVersion=;CFBundlePackageType=;CFBundleSignature=;CFBundleAllowMixedLocalizations=;UISupportedInterfaceOrientations=;CFBundleExecutable=;CFBundleResourceSpecification=;LSRequiresIPhoneOS=;CFBundleInfoDictionaryVersion=;CFBundleDevelopmentRegion=</VerInfo_Keys>
<SanitizedProjectName>SplitZip</SanitizedProjectName>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_DebugInformation>0</DCC_DebugInformation>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<DCC_UnitSearchPath>../../../;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<Manifest_File>(None)</Manifest_File>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">SplitZip.dpr</Source>
</Source>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1049</VersionInfo>
<VersionInfo Name="CodePage">1251</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
<VersionInfoKeys Name="CFBundleName"/>
<VersionInfoKeys Name="CFBundleDisplayName"/>
<VersionInfoKeys Name="UIDeviceFamily"/>
<VersionInfoKeys Name="CFBundleIdentifier"/>
<VersionInfoKeys Name="CFBundleVersion"/>
<VersionInfoKeys Name="CFBundlePackageType"/>
<VersionInfoKeys Name="CFBundleSignature"/>
<VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
<VersionInfoKeys Name="UISupportedInterfaceOrientations"/>
<VersionInfoKeys Name="CFBundleExecutable"/>
<VersionInfoKeys Name="CFBundleResourceSpecification"/>
<VersionInfoKeys Name="LSRequiresIPhoneOS"/>
<VersionInfoKeys Name="CFBundleInfoDictionaryVersion"/>
<VersionInfoKeys Name="CFBundleDevelopmentRegion"/>
</VersionInfoKeys>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>

View File

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="SplitZip"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="SplitZip.dpr"/>
<IsPartOfProject Value="True"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="..\..\..;$(ProjOutDir)"/>
<Libraries Value="..\..\..\fpc_lib"/>
<OtherUnitFiles Value="..\..\.."/>
<UnitOutputDirectory Value="."/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
</Linking>
<Other>
<CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,24 @@
rd /S /Q "%cd%\backup\"
rd /S /Q "%cd%\ConverterBackup\"
rd /S /Q "%cd%\lib\"
rd /S /Q "%cd%\__history\"
rd /S /Q "%cd%\__recovery\"
del "%cd%\*.o"
del "%cd%\*.a"
del "%cd%\*.or"
del "%cd%\*.lps"
del "%cd%\*.obj"
del "%cd%\*.exe"
del "%cd%\*.ppu"
del "%cd%\*.dcu"
del "%cd%\*.log"
del "%cd%\*.compiled"
del "%cd%\*.cfg"
del "%cd%\*.dof"
del "%cd%\*.dproj.local"
del "%cd%\*.identcache"
del "%cd%\*.dsk"
del "%cd%\*.skincfg"
del "%cd%\*.bak"
del "%cd%\*.rsm"
del "%cd%\*.~*"

View File

@@ -0,0 +1,109 @@
////////////////////////////////////////////////////////////////////////////////
//
// ****************************************************************************
// * Project : FWZip
// * Unit Name : CreateMultiPartZip
// * Purpose : Демонстрация создания архива с разбитием на части по 1 килобайту
// * Author : Александр (Rouse_) Багель
// * Copyright : © Fangorn Wizards Lab 1998 - 2023.
// * Version : 2.0.0
// * Home Page : http://rouse.drkb.ru
// * Home Blog : http://alexander-bagel.blogspot.ru
// ****************************************************************************
// * Stable Release : http://rouse.drkb.ru/components.php#fwzip
// * Latest Source : https://github.com/AlexanderBagel/FWZip
// ****************************************************************************
//
// Используемые источники:
// ftp://ftp.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
// https://zlib.net/zlib-1.2.13.tar.gz
// http://www.base2ti.com/
//
// Данный пример показывает как можно разделить большой архив на несколько частей,
// для их последующей записи на внешние носители информации
// или передачи частями по сети при неустойчивом соединении, затрудняющем
// передачу архива большого размера
program CreateMultiPartZip;
{$IFDEF FPC}
{$MODE Delphi}
{$H+}
{$ELSE}
{$APPTYPE CONSOLE}
{$ENDIF}
uses
SysUtils,
TypInfo,
FWZipZLib,
FWZipWriter,
FWZipStream;
var
Zip: TFWZipWriter;
Item: TFWZipWriterItem;
I: Integer;
BuildZipResult: TBuildZipResult;
MultiStream: TFWFileMultiStream;
begin
SetCurrentDir(ExtractFilePath(ParamStr(0)));
try
Zip := TFWZipWriter.Create;
try
// Для начала добавим в корень архива файлы из корневой директории
Zip.AddFolder('..\..\..\', False);
// Теперь изменим им свойства:
for I := 0 to Zip.Count - 1 do
begin
Item := Zip[I];
// Изменим коментарий
Item.Comment := string('Тестовый коментарий к файлу ') + Item.FileName;
// Установим пароль
Item.Password := 'password';
// Изменим тип сжатия
Item.CompressionLevel := TCompressionLevel(Byte(I mod 4));
end;
Zip.Comment := 'Тестовый коментарий ко всему архиву';
// Вся логика создания многотомных архивов заключается в классе
// TFWAbstractMultiStream от которого реализуются наследники
// предоставляющие конкретную реализацию.
// В частности TFWFileMultiStream позволяет работать с архивами
// расположенными на локальном диске.
// Если потребуется работа с архивами расположенными удаленно
// на FTP или облаке, допустим SharePoint ресурсе,
// потребуется реализовывать собственный наследник.
// Первый параметром идет имя архива, вторым максимальный размер его частей.
// Созданные тома многотомного архива не обязательно будут соответствовать
// указанному значению, т.к. согласно спецификации, структуры TCentralDirectoryFileHeader
// должны целиком располагаться внутри тома, поэтому размер финальных
// томов архива может немного уменьшаться в диапазоне от 1 байта
// до SizeOf(TCentralDirectoryFileHeader).
// Так-же размер последнего тома не может быть меньше чем размер структуры
// TEndOfCentralDir, а если используется Zip64, то к этому размеру добавляется размеры
// TZip64EOFCentralDirectoryRecord и TZip64EOFCentralDirectoryLocator.
MultiStream := TFWFileMultiStream.CreateWrite(
'..\..\DemoResults\MultyPartZip\MultyPartZip.zip', $20000);
try
// Для создания многотомного архива указываем не имя файла, а сам MultiStream
BuildZipResult := Zip.BuildZip(MultiStream);
finally
MultiStream.Free;
end;
// ... и выведим результат
Writeln(GetEnumName(TypeInfo(TBuildZipResult), Integer(BuildZipResult)));
finally
Zip.Free;
end;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.

View File

@@ -0,0 +1,112 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{FD2F810F-8C8F-48F6-83C3-CCB828985A38}</ProjectGuid>
<MainSource>CreateMultiPartZip.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>19.2</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_E>false</DCC_E>
<DCC_F>false</DCC_F>
<DCC_K>false</DCC_K>
<DCC_N>false</DCC_N>
<DCC_S>false</DCC_S>
<DCC_ImageBase>00400000</DCC_ImageBase>
<SanitizedProjectName>CreateMultiPartZip</SanitizedProjectName>
<VerInfo_Locale>1049</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=</VerInfo_Keys>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<BT_BuildType>Debug</BT_BuildType>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_DebugInformation>0</DCC_DebugInformation>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<DCC_UnitSearchPath>../../../;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<Manifest_File>(None)</Manifest_File>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">CreateMultiPartZip.dpr</Source>
</Source>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>

View File

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="CreateMultiPartZip"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="CreateMultiPartZip.dpr"/>
<IsPartOfProject Value="True"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="..\..\..;$(ProjOutDir)"/>
<Libraries Value="..\..\..\fpc_lib"/>
<OtherUnitFiles Value="..\..\.."/>
<UnitOutputDirectory Value="."/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
</Linking>
<Other>
<CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,24 @@
rd /S /Q "%cd%\backup\"
rd /S /Q "%cd%\ConverterBackup\"
rd /S /Q "%cd%\lib\"
rd /S /Q "%cd%\__history\"
rd /S /Q "%cd%\__recovery\"
del "%cd%\*.o"
del "%cd%\*.a"
del "%cd%\*.or"
del "%cd%\*.lps"
del "%cd%\*.obj"
del "%cd%\*.exe"
del "%cd%\*.ppu"
del "%cd%\*.dcu"
del "%cd%\*.log"
del "%cd%\*.compiled"
del "%cd%\*.cfg"
del "%cd%\*.dof"
del "%cd%\*.dproj.local"
del "%cd%\*.identcache"
del "%cd%\*.dsk"
del "%cd%\*.skincfg"
del "%cd%\*.bak"
del "%cd%\*.rsm"
del "%cd%\*.~*"

View File

@@ -0,0 +1,130 @@
////////////////////////////////////////////////////////////////////////////////
//
// ****************************************************************************
// * Project : FWZip
// * Unit Name : ModifyMultiPartZip
// * Purpose : Демонстрация модификации многотомного архива
// * Author : Александр (Rouse_) Багель
// * Copyright : © Fangorn Wizards Lab 1998 - 2023.
/// * Version : 2.0.0
// * Home Page : http://rouse.drkb.ru
// * Home Blog : http://alexander-bagel.blogspot.ru
// ****************************************************************************
// * Stable Release : http://rouse.drkb.ru/components.php#fwzip
// * Latest Source : https://github.com/AlexanderBagel/FWZip
// ****************************************************************************
//
// Используемые источники:
// ftp://ftp.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
// https://zlib.net/zlib-1.2.13.tar.gz
// http://www.base2ti.com/
//
// Хоть модификация многотомных архивов идея достаточно странная сама по себе,
// но архитектура фреймворка легко позволяет это осуществить.
// При чем модификатор будет спокойно работать и с обычными архивами и с многотомными
// модифицируя оба типа архивов, а так-же легко может провести конвертацию
// без этапа перепаковки данных из многотомного архива в обычный и наоборот.
program ModifyMultiPartZip;
{$IFDEF FPC}
{$MODE Delphi}
{$H+}
{$ELSE}
{$APPTYPE CONSOLE}
{$ENDIF}
uses
SysUtils,
Classes,
TypInfo,
FWZipZLib,
FWZipWriter,
FWZipStream,
FWZipModifier;
var
Writer: TFWZipWriter;
S: TStringStream;
MultiStreamRead, MultiStreamWrite: TFWFileMultiStream;
Modifier: TFWZipModifier;
I, Index1, Index2: Integer;
BuildZipResult: TBuildZipResult;
begin
SetCurrentDir(ExtractFilePath(ParamStr(0)));
try
// Модификация многотомного архиве ничем не отличается от модификации
// обычного архива, за исключением использования наследников
// TFWAbstractMultiStream для чтения и записи
// Например возьмем архив созданный в примере CreateMultyPartZip.dpr
// и удалим из него все *.pas файлы.
// А так-же добавим файлы из обычного не многотомного архива
MultiStreamRead := TFWFileMultiStream.CreateRead(
'..\..\DemoResults\MultyPartZip\MultyPartZip.zip');
try
Modifier := TFWZipModifier.Create;
try
// загружаем многотомный архив в модификатор
Index1 := Modifier.AddZipFile(MultiStreamRead);
// добавляем все элементы архива
Modifier.AddFromZip(Index1);
// удаляем все PAS файлы
for I := Modifier.Count - 1 downto 0 do
if AnsiLowerCase(ExtractFileExt(Modifier[I].FileName)) = '.pas' then
Modifier.DeleteItem(I);
// теперь создадим простой архив
Writer := TFWZipWriter.Create;
try
S := TStringStream.Create('Просто тестовые данные для демонстрации');
Writer.AddStream('test_stream.txt', S, soOwned);
Writer.BuildZip('..\..\DemoResults\MultyPartZip\stream.zip')
finally
Writer.Free;
end;
// загружаем обычный архив в модификатор
Index2 := Modifier.AddZipFile('..\..\DemoResults\MultyPartZip\stream.zip');
// добавляем единственный элемент простого архива
Modifier.AddFromZip(Index2, 'test_stream.txt');
// ... и сохранияем все в новый архив
// Причем!
// т.к. мы не указываем второй параметр, отвечающий за размер каждого тома
// то он берется по умолчанию и новый архив будет сформирован с томами
// другого размера, чем был в изначальном архиве.
// Все изменения произойдут на лету, вам не нужно их контролировать.
MultiStreamWrite := TFWFileMultiStream.CreateWrite(
'..\..\DemoResults\MultyPartZip\MultyPartZipWithoutPas.zip');
try
BuildZipResult := Modifier.BuildZip(MultiStreamWrite);
finally
MultiStreamWrite.Free;
end;
finally
Modifier.Free;
end;
finally
MultiStreamRead.Free;
end;
// ... выводим результат
Writeln(GetEnumName(TypeInfo(TBuildZipResult), Integer(BuildZipResult)));
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.

View File

@@ -0,0 +1,112 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{431C00A8-F08F-463E-8EBD-90AE046E4363}</ProjectGuid>
<MainSource>ModifyMultiPartZip.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>19.2</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_E>false</DCC_E>
<DCC_F>false</DCC_F>
<DCC_K>false</DCC_K>
<DCC_N>false</DCC_N>
<DCC_S>false</DCC_S>
<DCC_ImageBase>00400000</DCC_ImageBase>
<SanitizedProjectName>ModifyMultiPartZip</SanitizedProjectName>
<VerInfo_Locale>1049</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=</VerInfo_Keys>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<BT_BuildType>Debug</BT_BuildType>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_DebugInformation>0</DCC_DebugInformation>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<DCC_UnitSearchPath>../../../;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<Manifest_File>(None)</Manifest_File>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">ModifyMultiPartZip.dpr</Source>
</Source>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>

View File

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="ModifyMultiPartZip"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="ModifyMultiPartZip.dpr"/>
<IsPartOfProject Value="True"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="..\..\..;$(ProjOutDir)"/>
<Libraries Value="..\..\..\fpc_lib"/>
<OtherUnitFiles Value="..\..\.."/>
<UnitOutputDirectory Value="."/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
</Linking>
<Other>
<CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,24 @@
rd /S /Q "%cd%\backup\"
rd /S /Q "%cd%\ConverterBackup\"
rd /S /Q "%cd%\lib\"
rd /S /Q "%cd%\__history\"
rd /S /Q "%cd%\__recovery\"
del "%cd%\*.o"
del "%cd%\*.a"
del "%cd%\*.or"
del "%cd%\*.lps"
del "%cd%\*.obj"
del "%cd%\*.exe"
del "%cd%\*.ppu"
del "%cd%\*.dcu"
del "%cd%\*.log"
del "%cd%\*.compiled"
del "%cd%\*.cfg"
del "%cd%\*.dof"
del "%cd%\*.dproj.local"
del "%cd%\*.identcache"
del "%cd%\*.dsk"
del "%cd%\*.skincfg"
del "%cd%\*.bak"
del "%cd%\*.rsm"
del "%cd%\*.~*"

View File

@@ -0,0 +1,98 @@
////////////////////////////////////////////////////////////////////////////////
//
// ****************************************************************************
// * Project : FWZip
// * Unit Name : ReadMultiPartZip
// * Purpose : Демонстрация чтения многотомного архива
// * Author : Александр (Rouse_) Багель
// * Copyright : © Fangorn Wizards Lab 1998 - 2023.
// * Version : 2.0.0
// * Home Page : http://rouse.drkb.ru
// * Home Blog : http://alexander-bagel.blogspot.ru
// ****************************************************************************
// * Stable Release : http://rouse.drkb.ru/components.php#fwzip
// * Latest Source : https://github.com/AlexanderBagel/FWZip
// ****************************************************************************
//
// Используемые источники:
// ftp://ftp.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
// https://zlib.net/zlib-1.2.13.tar.gz
// http://www.base2ti.com/
//
program ReadMultiPartZip;
{$IFDEF FPC}
{$MODE Delphi}
{$H+}
{$ELSE}
{$APPTYPE CONSOLE}
{$ENDIF}
uses
SysUtils,
TypInfo,
FWZipStream,
FWZipReader;
var
Reader: TFWZipReader;
MultiStream: TFWFileMultiStream;
begin
SetCurrentDir(ExtractFilePath(ParamStr(0)));
try
// Для чтения многотомных архивов так-же потребуется класс
// наследник от TFWAbstractMultiStream.
// В случае чтения используется конструктор CreateRead.
// Первый параметр - путь к заголовку архива.
// Второй параметр, режим открытия.
// rsmQuick - ищутся все тома с конца не совпадающие размером с
// первым томом, вплоть до тех пор, пока не найдется равный.
// Остальные тома считаются равными первому.
// Это быстрый способ открытия многотомного архива, но не совсем надежный,
// по причине того что в тех случаях, когда один из томов
// содержащий записи TCentralDirectoryFileHeader совпадет по размерам
// с первым томом, все предыдущие будут считаться полными томами
// содержащими данные, хотя это может быть не так.
// Для гарантированного открытия нужно использовать режим rsmFull.
// В этом случае будет зачитан фактический размер каждого тома архива.
// Но, это более медленный вариант, особенно в том случае, когда
// реальных томов достаточно много.
// На количестве томов 60 тысяч и более время открытия может
// исчислятся минутами!
MultiStream := TFWFileMultiStream.CreateRead(
'..\..\DemoResults\MultyPartZip\MultyPartZip.zip', rsmQuick);
try
Reader := TFWZipReader.Create;
try
// Чтение многотомных архивов осуществляется ТОЛЬКО через вызов метода
// LoadFromStream с передачей параметров наследника класса TFWAbstractMultiStream
Reader.LoadFromStream(MultiStream);
// Вся остальная работа с архивом выглядит так-же как и с обычным.
Reader.PasswordList.Add('password');
// Например проверка целостности архива
Reader.Check;
// ... или его распаковка
Reader.ExtractAll('*.pas', '..\..\DemoResults\MultyPartZip\');
Writeln('done.');
finally
Reader.Free;
end;
finally
MultiStream.Free;
end;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.

View File

@@ -0,0 +1,112 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{19C51B88-FFA7-4F17-A41B-4EB644FA4152}</ProjectGuid>
<MainSource>ReadMultiPartZip.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>19.2</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_E>false</DCC_E>
<DCC_F>false</DCC_F>
<DCC_K>false</DCC_K>
<DCC_N>false</DCC_N>
<DCC_S>false</DCC_S>
<DCC_ImageBase>00400000</DCC_ImageBase>
<SanitizedProjectName>ReadMultiPartZip</SanitizedProjectName>
<VerInfo_Locale>1049</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=</VerInfo_Keys>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<BT_BuildType>Debug</BT_BuildType>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_DebugInformation>0</DCC_DebugInformation>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<DCC_UnitSearchPath>../../../;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<Manifest_File>(None)</Manifest_File>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">ReadMultiPartZip.dpr</Source>
</Source>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>

View File

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="ReadMultiPartZip"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="ReadMultiPartZip.dpr"/>
<IsPartOfProject Value="True"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="..\..\..;$(ProjOutDir)"/>
<Libraries Value="..\..\..\fpc_lib"/>
<OtherUnitFiles Value="..\..\.."/>
<UnitOutputDirectory Value="."/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
</Linking>
<Other>
<CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,24 @@
rd /S /Q "%cd%\backup\"
rd /S /Q "%cd%\ConverterBackup\"
rd /S /Q "%cd%\lib\"
rd /S /Q "%cd%\__history\"
rd /S /Q "%cd%\__recovery\"
del "%cd%\*.o"
del "%cd%\*.a"
del "%cd%\*.or"
del "%cd%\*.lps"
del "%cd%\*.obj"
del "%cd%\*.exe"
del "%cd%\*.ppu"
del "%cd%\*.dcu"
del "%cd%\*.log"
del "%cd%\*.compiled"
del "%cd%\*.cfg"
del "%cd%\*.dof"
del "%cd%\*.dproj.local"
del "%cd%\*.identcache"
del "%cd%\*.dsk"
del "%cd%\*.skincfg"
del "%cd%\*.bak"
del "%cd%\*.rsm"
del "%cd%\*.~*"

View File

@@ -0,0 +1,19 @@
program FWZipPerfomance;
{$IFDEF FPC}
{$MODE Delphi}
{$ENDIF}
uses
{$IFDEF FPC}
Interfaces,
{$ENDIF }
Forms,
Unit1 in 'Unit1.pas' {Form1};
{$IFNDEF FPC}
{$R *.res}
{$ENDIF}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,918 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{69C44A8C-22A5-4248-B1C8-29A82DBA1D5C}</ProjectGuid>
<MainSource>FWZipPerfomance.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Application</AppType>
<FrameworkType>VCL</FrameworkType>
<ProjectVersion>19.2</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
<Base_Win64>true</Base_Win64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
<Cfg_1_Win32>true</Cfg_1_Win32>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_E>false</DCC_E>
<DCC_F>false</DCC_F>
<DCC_K>false</DCC_K>
<DCC_N>false</DCC_N>
<DCC_S>false</DCC_S>
<DCC_ImageBase>00400000</DCC_ImageBase>
<SanitizedProjectName>FWZipPerfomance</SanitizedProjectName>
<DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Locale>1049</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<BT_BuildType>Debug</BT_BuildType>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_DebugInformation>0</DCC_DebugInformation>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
<DCC_UnitSearchPath>../../;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="Unit1.pas">
<Form>Form1</Form>
</DCCReference>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">FWZipPerfomance.dpr</Source>
</Source>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
<Deployment Version="3">
<DeployFile LocalName="FWZipPerfomance.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>FWZipPerfomance.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClassesDexFile">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidFileProvider">
<Platform Name="Android">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidGDBServer">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiFile">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiv7aFile">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeMipsFile">
<Platform Name="Android">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashImageDef">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStyles">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStylesV21">
<Platform Name="Android">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Colors">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_DefaultAppIcon">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon144">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon192">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon24">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage426">
<Platform Name="Android">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage470">
<Platform Name="Android">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage640">
<Platform Name="Android">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage960">
<Platform Name="Android">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Strings">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyFramework">
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyModule">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="DependencyPackage">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.bpl</Extensions>
</Platform>
</DeployClass>
<DeployClass Name="File">
<Platform Name="Android">
<Operation>0</Operation>
</Platform>
<Platform Name="Android64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>0</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iOS_AppStore1024">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_AppIcon152">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_AppIcon167">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_LaunchDark2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Notification40">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Setting58">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_SpotLight80">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_AppIcon120">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_AppIcon180">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch3x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_LaunchDark2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_LaunchDark3x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Notification40">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Notification60">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Setting58">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Setting87">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Spotlight120">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Spotlight80">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectAndroidManifest">
<Platform Name="Android">
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSEntitlements">
<Platform Name="iOSDevice32">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSInfoPList">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSLaunchScreen">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen</RemoteDir>
<Operation>64</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen</RemoteDir>
<Operation>64</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSResource">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXDebug">
<Platform Name="OSX64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXEntitlements">
<Platform Name="OSX32">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXInfoPList">
<Platform Name="OSX32">
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="Linux64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectUWPManifest">
<Platform Name="Win32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo150">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo44">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
</Deployment>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
<Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
</Project>

View File

@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="FWZipPerfomance"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="LazUtils"/>
</Item>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="FWZipPerfomance.dpr"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="Unit1.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit>
<Unit>
<Filename Value="..\..\FWZipConsts.pas"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="..\..\FWZipCrc32.pas"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="..\..\FWZipCrypt.pas"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="..\..\FWZipReader.pas"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="..\..\FWZipStream.pas"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="..\..\FWZipWriter.pas"/>
<IsPartOfProject Value="True"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="..\..;$(ProjOutDir)"/>
<Libraries Value="..\..\fpc_lib"/>
<OtherUnitFiles Value="..\.."/>
<UnitOutputDirectory Value="."/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,258 @@
object Form1: TForm1
Left = 381
Top = 183
Caption = #1058#1077#1089#1090' '#1087#1088#1086#1080#1079#1074#1086#1076#1080#1090#1077#1083#1100#1085#1086#1089#1090#1080' FWZip'
ClientHeight = 615
ClientWidth = 562
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
DesignSize = (
562
615)
PixelsPerInch = 96
TextHeight = 13
object GroupBox1: TGroupBox
Left = 8
Top = 8
Width = 527
Height = 105
Anchors = [akLeft, akTop, akRight]
Caption = #1053#1072#1089#1090#1088#1086#1081#1082#1080' '#1089#1078#1072#1090#1080#1103
TabOrder = 0
DesignSize = (
527
105)
object LabeledEdit1: TLabeledEdit
Left = 16
Top = 40
Width = 469
Height = 21
Anchors = [akLeft, akTop, akRight]
EditLabel.Width = 149
EditLabel.Height = 13
EditLabel.Caption = #1042#1099#1073#1077#1088#1080#1090#1077' '#1087#1072#1087#1082#1091' '#1076#1083#1103' '#1089#1078#1072#1090#1080#1103':'
TabOrder = 0
Text = 'D:\StroyInfo 5'
OnChange = LabeledEdit1Change
end
object Button1: TButton
Left = 491
Top = 38
Width = 26
Height = 25
Hint = #1054#1073#1079#1086#1088'...'
Anchors = [akTop, akRight]
Caption = '...'
ParentShowHint = False
ShowHint = True
TabOrder = 1
OnClick = Button1Click
end
object CheckBox1: TCheckBox
Left = 16
Top = 72
Width = 145
Height = 17
Caption = #1064#1080#1092#1088#1086#1074#1072#1090#1100' '#1087#1088#1080' '#1089#1078#1072#1090#1080#1080
TabOrder = 2
OnClick = CheckBox1Click
end
object LabeledEdit2: TLabeledEdit
Left = 264
Top = 70
Width = 172
Height = 21
Anchors = [akLeft, akTop, akRight]
EditLabel.Width = 84
EditLabel.Height = 13
EditLabel.Caption = #1059#1082#1072#1078#1080#1090#1077' '#1087#1072#1088#1086#1083#1100
Enabled = False
LabelPosition = lpLeft
TabOrder = 3
end
object Button2: TButton
Left = 442
Top = 69
Width = 75
Height = 25
Anchors = [akTop, akRight]
Caption = #1057#1078#1072#1090#1100
TabOrder = 4
OnClick = Button2Click
end
end
object GroupBox2: TGroupBox
Left = 8
Top = 128
Width = 527
Height = 137
Anchors = [akLeft, akTop, akRight]
Caption = #1053#1072#1089#1090#1088#1086#1081#1082#1080' '#1088#1072#1089#1087#1072#1082#1086#1074#1082#1080
TabOrder = 1
DesignSize = (
527
137)
object LabeledEdit3: TLabeledEdit
Left = 16
Top = 40
Width = 469
Height = 21
Anchors = [akLeft, akTop, akRight]
EditLabel.Width = 171
EditLabel.Height = 13
EditLabel.Caption = #1042#1099#1073#1077#1088#1080#1090#1077' '#1072#1088#1093#1080#1074' '#1076#1083#1103' '#1088#1072#1089#1087#1072#1082#1086#1074#1082#1080':'
TabOrder = 0
OnChange = LabeledEdit3Change
end
object Button3: TButton
Left = 491
Top = 38
Width = 26
Height = 25
Hint = #1054#1073#1079#1086#1088'...'
Anchors = [akTop, akRight]
Caption = '...'
ParentShowHint = False
ShowHint = True
TabOrder = 1
OnClick = Button3Click
end
object CheckBox2: TCheckBox
Left = 16
Top = 72
Width = 145
Height = 17
Caption = #1040#1088#1093#1080#1074' '#1079#1072#1096#1080#1092#1088#1086#1074#1072#1085
TabOrder = 2
OnClick = CheckBox2Click
end
object LabeledEdit4: TLabeledEdit
Left = 264
Top = 70
Width = 167
Height = 21
Anchors = [akLeft, akTop, akRight]
EditLabel.Width = 84
EditLabel.Height = 13
EditLabel.Caption = #1059#1082#1072#1078#1080#1090#1077' '#1087#1072#1088#1086#1083#1100
Enabled = False
LabelPosition = lpLeft
TabOrder = 3
end
object Button4: TButton
Left = 442
Top = 68
Width = 75
Height = 25
Anchors = [akTop, akRight]
Caption = #1056#1072#1089#1087#1072#1082#1086#1074#1072#1090#1100
TabOrder = 4
OnClick = Button4Click
end
object Button6: TButton
Tag = 1
Left = 442
Top = 99
Width = 75
Height = 25
Anchors = [akTop, akRight]
Caption = #1055#1088#1086#1074#1077#1088#1080#1090#1100
TabOrder = 5
OnClick = Button4Click
end
end
object GroupBox3: TGroupBox
Left = 8
Top = 271
Width = 527
Height = 178
Anchors = [akLeft, akTop, akRight]
Caption = #1055#1088#1086#1080#1079#1074#1086#1076#1080#1090#1077#1083#1100#1085#1086#1089#1090#1100':'
TabOrder = 2
DesignSize = (
527
178)
object Label1: TLabel
Left = 16
Top = 24
Width = 163
Height = 13
Caption = #1058#1077#1082#1091#1097#1080#1081' '#1088#1072#1089#1093#1086#1076' '#1087#1072#1084#1103#1090#1080': 0 '#1073#1072#1081#1090
end
object Label2: TLabel
Left = 16
Top = 43
Width = 163
Height = 13
Caption = #1055#1080#1082#1086#1074#1099#1081' '#1088#1072#1089#1093#1086#1076' '#1087#1072#1084#1103#1090#1080': 0 '#1073#1072#1081#1090
end
object Label3: TLabel
Left = 16
Top = 62
Width = 166
Height = 13
Caption = #1054#1073#1097#1077#1077' '#1082#1086#1083#1080#1095#1077#1089#1090#1074#1086' '#1101#1083#1077#1084#1077#1085#1090#1086#1074': 0'
end
object Label4: TLabel
Left = 16
Top = 81
Width = 142
Height = 13
Caption = #1054#1073#1097#1077#1077' '#1088#1072#1079#1084#1077#1088' '#1101#1083#1077#1084#1077#1085#1090#1086#1074': 0'
end
object Label5: TLabel
Left = 16
Top = 109
Width = 501
Height = 13
Anchors = [akLeft, akTop, akRight]
AutoSize = False
end
object ProgressBar1: TProgressBar
Left = 16
Top = 128
Width = 498
Height = 17
Anchors = [akLeft, akTop, akRight]
TabOrder = 0
end
object ProgressBar2: TProgressBar
Left = 16
Top = 151
Width = 498
Height = 17
Anchors = [akLeft, akTop, akRight]
TabOrder = 1
end
object Button5: TButton
Left = 439
Top = 97
Width = 75
Height = 25
Anchors = [akTop, akRight]
Caption = #1054#1089#1090#1072#1085#1086#1074#1080#1090#1100
TabOrder = 2
Visible = False
OnClick = Button5Click
end
end
object Memo1: TMemo
Left = 8
Top = 456
Width = 527
Height = 146
Anchors = [akLeft, akTop, akRight, akBottom]
ScrollBars = ssVertical
TabOrder = 3
end
object OpenDialog1: TOpenDialog
Left = 376
Top = 224
end
end

View File

@@ -0,0 +1,260 @@
object Form1: TForm1
Left = 381
Height = 981
Top = 183
Width = 867
Caption = 'Тест производительности FWZip'
ClientHeight = 981
ClientWidth = 867
Color = clBtnFace
DesignTimePPI = 144
Font.Color = clWindowText
Font.Height = -17
Font.Name = 'Tahoma'
Position = poScreenCenter
LCLVersion = '2.2.6.0'
object GroupBox1: TGroupBox
Left = 12
Height = 158
Top = 12
Width = 791
Anchors = [akTop, akLeft, akRight]
Caption = 'Настройки сжатия'
ClientHeight = 132
ClientWidth = 787
TabOrder = 0
object LabeledEdit1: TLabeledEdit
Left = 21
Height = 29
Top = 39
Width = 700
Anchors = [akTop, akLeft, akRight]
EditLabel.Height = 21
EditLabel.Width = 700
EditLabel.Caption = 'Выберите папку для сжатия:'
EditLabel.ParentColor = False
TabOrder = 0
Text = 'D:\StroyInfo 5'
OnChange = LabeledEdit1Change
end
object Button1: TButton
Left = 730
Height = 38
Hint = 'Обзор...'
Top = 36
Width = 39
Anchors = [akTop, akRight]
Caption = '...'
OnClick = Button1Click
ParentShowHint = False
ShowHint = True
TabOrder = 1
end
object CheckBox1: TCheckBox
Left = 21
Height = 29
Top = 87
Width = 218
Caption = 'Шифровать при сжатии'
OnClick = CheckBox1Click
TabOrder = 2
end
object LabeledEdit2: TLabeledEdit
Left = 393
Height = 29
Top = 84
Width = 254
Anchors = [akTop, akLeft, akRight]
EditLabel.Height = 21
EditLabel.Width = 126
EditLabel.Caption = 'Укажите пароль'
EditLabel.ParentColor = False
Enabled = False
LabelPosition = lpLeft
TabOrder = 3
end
object Button2: TButton
Left = 657
Height = 38
Top = 82
Width = 112
Anchors = [akTop, akRight]
Caption = 'Сжать'
OnClick = Button2Click
TabOrder = 4
end
end
object GroupBox2: TGroupBox
Left = 12
Height = 206
Top = 192
Width = 791
Anchors = [akTop, akLeft, akRight]
Caption = 'Настройки распаковки'
ClientHeight = 180
ClientWidth = 787
TabOrder = 1
object LabeledEdit3: TLabeledEdit
Left = 21
Height = 29
Top = 39
Width = 700
Anchors = [akTop, akLeft, akRight]
EditLabel.Height = 21
EditLabel.Width = 700
EditLabel.Caption = 'Выберите архив для распаковки:'
EditLabel.ParentColor = False
TabOrder = 0
OnChange = LabeledEdit3Change
end
object Button3: TButton
Left = 730
Height = 38
Hint = 'Обзор...'
Top = 36
Width = 39
Anchors = [akTop, akRight]
Caption = '...'
OnClick = Button3Click
ParentShowHint = False
ShowHint = True
TabOrder = 1
end
object CheckBox2: TCheckBox
Left = 21
Height = 29
Top = 87
Width = 181
Caption = 'Архив зашифрован'
OnClick = CheckBox2Click
TabOrder = 2
end
object LabeledEdit4: TLabeledEdit
Left = 393
Height = 29
Top = 84
Width = 247
Anchors = [akTop, akLeft, akRight]
EditLabel.Height = 21
EditLabel.Width = 126
EditLabel.Caption = 'Укажите пароль'
EditLabel.ParentColor = False
Enabled = False
LabelPosition = lpLeft
TabOrder = 3
end
object Button4: TButton
Left = 657
Height = 38
Top = 81
Width = 112
Anchors = [akTop, akRight]
Caption = 'Распаковать'
OnClick = Button4Click
TabOrder = 4
end
object Button6: TButton
Tag = 1
Left = 657
Height = 38
Top = 128
Width = 112
Anchors = [akTop, akRight]
Caption = 'Проверить'
OnClick = Button4Click
TabOrder = 5
end
end
object GroupBox3: TGroupBox
Left = 12
Height = 267
Top = 406
Width = 791
Anchors = [akTop, akLeft, akRight]
Caption = 'Производительность:'
ClientHeight = 241
ClientWidth = 787
TabOrder = 2
object Label1: TLabel
Left = 21
Height = 21
Top = 15
Width = 248
Caption = 'Текущий расход памяти: 0 байт'
ParentColor = False
end
object Label2: TLabel
Left = 21
Height = 21
Top = 44
Width = 249
Caption = 'Пиковый расход памяти: 0 байт'
ParentColor = False
end
object Label3: TLabel
Left = 21
Height = 21
Top = 72
Width = 252
Caption = 'Общее количество элементов: 0'
ParentColor = False
end
object Label4: TLabel
Left = 21
Height = 21
Top = 100
Width = 219
Caption = 'Общее размер элементов: 0'
ParentColor = False
end
object Label5: TLabel
Left = 21
Height = 20
Top = 142
Width = 748
Anchors = [akTop, akLeft, akRight]
AutoSize = False
ParentColor = False
end
object ProgressBar1: TProgressBar
Left = 21
Height = 26
Top = 171
Width = 744
Anchors = [akTop, akLeft, akRight]
TabOrder = 0
end
object ProgressBar2: TProgressBar
Left = 21
Height = 26
Top = 206
Width = 744
Anchors = [akTop, akLeft, akRight]
TabOrder = 1
end
object Button5: TButton
Left = 653
Height = 38
Top = 124
Width = 112
Anchors = [akTop, akRight]
Caption = 'Остановить'
OnClick = Button5Click
TabOrder = 2
Visible = False
end
end
object Memo1: TMemo
Left = 12
Height = 219
Top = 684
Width = 791
Anchors = [akTop, akLeft, akRight, akBottom]
ScrollBars = ssVertical
TabOrder = 3
end
object OpenDialog1: TOpenDialog
Left = 564
Top = 336
end
end

View File

@@ -0,0 +1,323 @@
////////////////////////////////////////////////////////////////////////////////
//
// ****************************************************************************
// * Project : FWZip - FWZipPerfomance
// * Purpose : Тестирование производительности FWZip
// * Author : Александр (Rouse_) Багель
// * Copyright : © Fangorn Wizards Lab 1998 - 2023.
// * Version : 2.0.0
// * Home Page : http://rouse.drkb.ru
// * Home Blog : http://alexander-bagel.blogspot.ru
// ****************************************************************************
// * Stable Release : http://rouse.drkb.ru/components.php#fwzip
// * Latest Source : https://github.com/AlexanderBagel/FWZip
// ****************************************************************************
//
// Используемые источники:
// ftp://ftp.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
// https://zlib.net/zlib-1.2.13.tar.gz
// http://www.base2ti.com/
//
unit Unit1;
{$IFDEF FPC}
{$MODE Delphi}
{$ENDIF}
interface
{$WARN SYMBOL_PLATFORM OFF}
{$WARN SYMBOL_DEPRECATED OFF}
{$WARN UNIT_PLATFORM OFF}
uses
{$IFDEF FPC}
LCLIntf, LCLType,
{$ELSE}
Windows, FileCtrl,
{$ENDIF}
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls,
FWZipWriter, FWZipReader, FWZipConsts;
type
TForm1 = class(TForm)
GroupBox1: TGroupBox;
LabeledEdit1: TLabeledEdit;
Button1: TButton;
CheckBox1: TCheckBox;
LabeledEdit2: TLabeledEdit;
Button2: TButton;
GroupBox2: TGroupBox;
LabeledEdit3: TLabeledEdit;
Button3: TButton;
CheckBox2: TCheckBox;
LabeledEdit4: TLabeledEdit;
Button4: TButton;
OpenDialog1: TOpenDialog;
GroupBox3: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
ProgressBar1: TProgressBar;
ProgressBar2: TProgressBar;
Label5: TLabel;
Button5: TButton;
Button6: TButton;
Memo1: TMemo;
procedure CheckBox1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure LabeledEdit1Change(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure CheckBox2Click(Sender: TObject);
procedure LabeledEdit3Change(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
private
InitialHeapSize, MaxHeapSize, AverageHeapSize: Int64;
TotalGetHeapStatusCount: Integer;
StopProcess: Boolean;
procedure OnProgress(Sender: TObject; const FileName: string;
Percent, TotalPercent: Byte; var Cancel: Boolean;
ProgressState: TProgressState);
procedure UpdateMemoryStatus;
procedure SetEnabledState(Value: Boolean);
procedure ClearZipData;
end;
var
Form1: TForm1;
implementation
{$IFDEF FPC}
{$R *.lfm}
{$ELSE}
{$R *.dfm}
{$ENDIF}
function GetTicks: UInt64;
begin
{$IFDEF FPC}
Result := GetTickCount64;
{$ELSE}
Result := GetTickCount;
{$ENDIF}
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Dir: string;
begin
if SelectDirectory('Укажите папку для сжатия', '', Dir) then
LabeledEdit1.Text := Dir;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
I: Integer;
TotalSize: Int64;
Heap: THeapStatus;
TicCount: Uint64;
Item: TFWZipWriterItem;
Writer: TFWZipWriter;
begin
Writer := TFWZipWriter.Create;
try
DeleteFile(
IncludeTrailingPathDelimiter(LabeledEdit1.Text) + 'FWZipTest.zip');
Writer.AddFolder('', LabeledEdit1.Text, '');
TotalSize := 0;
InitialHeapSize := 0;
for I := 0 to Writer.Count - 1 do
begin
Item := Writer[I];
Inc(TotalSize, Item.Size);
Inc(InitialHeapSize, SizeOf(TCentralDirectoryFileHeaderEx));
if LabeledEdit2.Text <> '' then
begin
Item.Password := LabeledEdit2.Text;
Item.NeedDescriptor := True;
end;
end;
Label3.Caption := 'Общее количество элементов: ' + IntToStr(Writer.Count);
Label4.Caption := 'Общий размер элементов: ' + IntToStr(TotalSize);
Writer.OnProgress := OnProgress;
SetEnabledState(False);
try
Heap := GetHeapStatus;
Inc(InitialHeapSize, Heap.Overhead + Heap.TotalAllocated);
MaxHeapSize := 0;
AverageHeapSize := 0;
TotalGetHeapStatusCount := 0;
StopProcess := False;
TicCount := GetTicks;
Writer.BuildZip(
IncludeTrailingPathDelimiter(LabeledEdit1.Text) + 'FWZipTest.zip');
if TotalGetHeapStatusCount = 0 then
TotalGetHeapStatusCount := 1;
ShowMessage(Format(
'Пиковый расход памяти: %d байт' + sLineBreak +
'Средний расход памяти: %d байт' + sLineBreak +
'Общее время работы: %d секунд',
[MaxHeapSize, AverageHeapSize div TotalGetHeapStatusCount,
(GetTicks - TicCount) div 1000]));
finally
SetEnabledState(True);
end;
finally
Writer.Free;
ClearZipData;
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
if OpenDialog1.Execute then
LabeledEdit3.Text := OpenDialog1.FileName;
end;
procedure TForm1.Button4Click(Sender: TObject);
var
I: Integer;
TotalSize: Int64;
Heap: THeapStatus;
TicCount: Uint64;
Path: string;
Reader: TFWZipReader;
begin
{$IFDEF FPC}
Path := '';
{$ENDIF}
SetLength(Path, MAX_PATH);
Path := LabeledEdit3.Text;
Path := ChangeFileExt(Path, '');
Reader := TFWZipReader.Create;
try
Reader.LoadFromFile(LabeledEdit3.Text);
TotalSize := 0;
for I := 0 to Reader.Count - 1 do
Inc(TotalSize, Reader[I].UncompressedSize);
Label3.Caption := 'Общее количество элементов: ' + IntToStr(Reader.Count);
Label4.Caption := 'Общий размер элементов: ' + IntToStr(TotalSize);
Reader.OnProgress := OnProgress;
if LabeledEdit4.Text <> '' then
Reader.PasswordList.Add(LabeledEdit4.Text);
SetEnabledState(False);
try
Heap := GetHeapStatus;
InitialHeapSize := Heap.Overhead + Heap.TotalAllocated;
MaxHeapSize := 0;
AverageHeapSize := 0;
TotalGetHeapStatusCount := 0;
StopProcess := False;
Memo1.Lines.Clear;
TicCount := GetTicks;
if TButton(Sender).Tag = 0 then
Reader.ExtractAll(Path)
else
Reader.Check;
if TotalGetHeapStatusCount = 0 then
TotalGetHeapStatusCount := 1;
ShowMessage(Format(
'Пиковый расход памяти: %d байт' + sLineBreak +
'Средний расход памяти: %d байт' + sLineBreak +
'Общее время работы: %d секунд',
[MaxHeapSize, AverageHeapSize div TotalGetHeapStatusCount,
(GetTicks - TicCount) div 1000]));
finally
SetEnabledState(True);
end;
finally
Reader.Free;
ClearZipData;
end;
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
StopProcess := True;
end;
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
LabeledEdit2.Enabled := CheckBox1.Checked;
end;
procedure TForm1.CheckBox2Click(Sender: TObject);
begin
LabeledEdit4.Enabled := CheckBox2.Checked;
end;
procedure TForm1.ClearZipData;
begin
Label1.Caption := 'Текущий расход памяти: 0 байт';
Label2.Caption := 'Пиковый расход памяти: 0 байт';
Label3.Caption := 'Общее количество элементов: 0';
Label4.Caption := 'Общий размер элементов: 0';
Label5.Caption := '';
end;
procedure TForm1.LabeledEdit1Change(Sender: TObject);
begin
Button2.Enabled := DirectoryExists(LabeledEdit1.Text);
end;
procedure TForm1.LabeledEdit3Change(Sender: TObject);
begin
Button4.Enabled := FileExists(LabeledEdit3.Text);
end;
procedure TForm1.OnProgress(Sender: TObject; const FileName: string; Percent,
TotalPercent: Byte; var Cancel: Boolean; ProgressState: TProgressState);
const
p: array [TProgressState] of string = ('psStart', 'psInitialization',
'psInProgress', 'psFinalization', 'psEnd', 'psException');
begin
Cancel := StopProcess;
Label5.Caption := Format('(%d) %s', [Percent, FileName]);
ProgressBar1.Position := Percent;
ProgressBar2.Position := TotalPercent;
Memo1.Lines.Add(Format('%s - %s percent %d total %d',
[FileName, P[ProgressState], Percent, TotalPercent]));
UpdateMemoryStatus;
end;
procedure TForm1.SetEnabledState(Value: Boolean);
begin
Button1.Enabled := Value;
Button2.Enabled := Value;
Button3.Enabled := Value;
Button4.Enabled := Value;
Button5.Visible := not Value;
Button6.Enabled := Value;
LabeledEdit1.Enabled := Value;
LabeledEdit2.Enabled := Value;
LabeledEdit3.Enabled := Value;
LabeledEdit4.Enabled := Value;
CheckBox1.Enabled := Value;
CheckBox2.Enabled := Value;
end;
procedure TForm1.UpdateMemoryStatus;
var
HeapStatus: THeapStatus;
HeapSize: Int64;
begin
HeapStatus := GetHeapStatus;
HeapSize := HeapStatus.Overhead + HeapStatus.TotalAllocated;
Dec(HeapSize, InitialHeapSize);
if HeapSize > MaxHeapSize then
MaxHeapSize := HeapSize;
Inc(TotalGetHeapStatusCount);
Inc(AverageHeapSize, HeapSize);
Label1.Caption := 'Текущий расход памяти: ' + IntToStr(HeapSize) + ' байт';
Label2.Caption := 'Пиковый расход памяти: ' + IntToStr(MaxHeapSize) + ' байт';
Application.ProcessMessages;
Application.ProcessMessages;
end;
end.

View File

@@ -0,0 +1,24 @@
rd /S /Q "%cd%\backup\"
rd /S /Q "%cd%\ConverterBackup\"
rd /S /Q "%cd%\lib\"
rd /S /Q "%cd%\__history\"
rd /S /Q "%cd%\__recovery\"
del "%cd%\*.o"
del "%cd%\*.a"
del "%cd%\*.or"
del "%cd%\*.lps"
del "%cd%\*.obj"
del "%cd%\*.exe"
del "%cd%\*.ppu"
del "%cd%\*.dcu"
del "%cd%\*.log"
del "%cd%\*.compiled"
del "%cd%\*.cfg"
del "%cd%\*.dof"
del "%cd%\*.dproj.local"
del "%cd%\*.identcache"
del "%cd%\*.dsk"
del "%cd%\*.skincfg"
del "%cd%\*.bak"
del "%cd%\*.rsm"
del "%cd%\*.~*"

View File

@@ -0,0 +1,356 @@
////////////////////////////////////////////////////////////////////////////////
//
// ****************************************************************************
// * Project : FWZip
// * Unit Name : BuildWithException
// * Purpose : Демонстрация работы с исключениями
// * : при создании и распаковке архива
// * Author : Александр (Rouse_) Багель
// * Copyright : © Fangorn Wizards Lab 1998 - 2023.
// * Version : 2.0.0
// * Home Page : http://rouse.drkb.ru
// * Home Blog : http://alexander-bagel.blogspot.ru
// ****************************************************************************
// * Stable Release : http://rouse.drkb.ru/components.php#fwzip
// * Latest Source : https://github.com/AlexanderBagel/FWZip
// ****************************************************************************
//
// Используемые источники:
// ftp://ftp.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
// https://zlib.net/zlib-1.2.13.tar.gz
// http://www.base2ti.com/
//
// Данный пример показывает работу с различными ошибками могущими возникнуть
// в процессе создания и распаковки архива, а так-же способы их обработки.
program BuildWithException;
{$IFDEF FPC}
{$MODE Delphi}
{$H+}
{$ELSE}
{$APPTYPE CONSOLE}
{$ENDIF}
uses
{$IFNDEF FPC}
Windows,
{$ENDIF}
Classes,
SysUtils,
TypInfo,
FWZipConsts,
FWZipWriter,
FWZipReader,
FWZipUtils;
const
INVALID_HANDLE_VALUE = THandle(-1);
ReadLock = fmOpenRead or fmShareDenyNone;
{$IFDEF LINUX}
WriteLock = fmOpenWrite or fmShareExclusive;
{$ELSE}
WriteLock = fmOpenWrite or fmShareDenyNone;
{$ENDIF}
var
Writer: TFWZipWriter;
Reader: TFWZipReader;
Method: TMethod;
hLockedFile: THandle;
//
// Процедура выводит результат работы функции BuildZip
// =============================================================================
procedure ShowBuildResult(Value: TBuildZipResult);
begin
Writeln(GetEnumName(TypeInfo(TBuildZipResult), Integer(Value)));
end;
//
// Процедура выводит результат работы функции Extract
// =============================================================================
procedure ShowManualExtractResult(const ElementName: string;
Value: TExtractResult);
begin
Writeln(Format('%s -> %s', [ElementName,
GetEnumName(TypeInfo(TExtractResult), Integer(Value))]));
end;
procedure DropLock;
begin
FileClose(hLockedFile);
hLockedFile := INVALID_HANDLE_VALUE;
end;
//
// смотри описание обработчика ниже
// =============================================================================
procedure OnException1({%H-}Self, Sender: TObject; {%H-}E: Exception;
const ItemIndex: Integer; var Action: TExceptionAction;
var NewFilePath: string; {%H-}NewFileData: TMemoryStream);
var
CurrentFilePath: string;
Src: THandleStream;
Dst: TFileStream;
hFile: THandle;
begin
{$IFDEF LINUX}
// с блокировкой под юниксом проблемы, поэтому пусть будет так
DropLock;
{$ENDIF}
CurrentFilePath := string(TFWZipWriter(Sender)[ItemIndex].FilePath);
NewFilePath := ChangeFileExt(CurrentFilePath, '.tmp');
hFile := FileOpen(CurrentFilePath, ReadLock);
try
Src := THandleStream.Create(hFile);
try
Dst := TFileStream.Create(NewFilePath, fmCreate);
try
Dst.CopyFrom(Src, 0);
finally
Dst.Free;
end;
finally
Src.Free;
end;
finally
FileClose(hFile);
end;
Action := eaUseNewFilePathAndDel;
end;
//
// смотри описание обработчика ниже
// =============================================================================
procedure OnException2({%H-}Self, Sender: TObject; {%H-}E: Exception;
const {%H-}ItemIndex: Integer; var Action: TExceptionAction;
var {%H-}NewFilePath: string; {%H-}NewFileData: TMemoryStream);
begin
DropLock;
Action := eaRetry;
end;
//
// смотри описание обработчика ниже
// =============================================================================
procedure OnException3({%H-}Self, Sender: TObject; {%H-}E: Exception;
const ItemIndex: Integer; var Action: TExceptionAction;
var {%H-}NewFilePath: string; NewFileData: TMemoryStream);
var
Src: THandleStream;
hFile: THandle;
begin
{$IFDEF LINUX}
// с блокировкой под юниксом проблемы, поэтому пусть будет так
DropLock;
{$ENDIF}
hFile := FileOpen(TFWZipWriter(Sender)[ItemIndex].FilePath, ReadLock);
try
Src := THandleStream.Create(hFile);
try
NewFileData.CopyFrom(Src, 0);
finally
Src.Free;
end;
finally
FileClose(hFile);
end;
Action := eaUseNewFileData;
end;
//
// смотри описание обработчика ниже
// =============================================================================
procedure OnDuplicate({%H-}Self, Sender: TObject;
var Path: string; var Action: TDuplicateAction);
begin
Path := MakeUniqueName(Path);
Action := daUseNewFilePath;
end;
var
I: Integer;
begin
SetCurrentDir(ExtractFilePath(ParamStr(0)));
try
// Самая банальная ошибка при создании архива - это отсутствие доступа
// к добавляемому в архив файлу.
// Например вот такой код пытается заархивировать содержимое корневой
// папки в которой искусственно залочен один из элементов
// В этом случае возникнет ошибка доступа к залоченому файлу.
// Если не назначены обработчики исключений, то такой файл будет пропущен
// (действие по умолчанию eaSkip) и функция BuildZip
// вернет следующие коды ошибок:
// brFailed - в случае если в папке небыло других файлов
// кроме залоченного (т.е. в архив добавлять нечего)
// brPartialBuild - в случае если в архив все-же были добавлены какие-либо файлы,
// но некоторые из них были пропущены
Writer := TFWZipWriter.Create;
try
Writer.AddFolder('', '..\..\', '*.pas', False);
// лочим один из файлов для демонстрации
hLockedFile := FileOpen(PathCanonicalize('..\..\' + Writer[0].FileName), WriteLock);
try
Write('BuildWithException1.zip -> ');
ShowBuildResult(Writer.BuildZip('..\DemoResults\BuildWithException1.zip'));
finally
FileClose(hLockedFile);
end;
finally
Writer.Free;
end;
// узнать какие файлы были пропущены и попытаться исправить данную ситуацию
// можно перекрытием события OnException
// В следующем примере будет показано как все-же обработать такую ошибку
// и добавить проблемный файл в архив
Writer := TFWZipWriter.Create;
try
Writer.AddFolder('', '..\..\', '*.pas', False);
// лочим один из файлов для демонстрации
hLockedFile := FileOpen(PathCanonicalize('..\..\' + Writer[0].FileName), WriteLock);
try
// Назначаем обработчик через который мы будем обрабатывать ошибку
// В обработчике OnException1 будет создаваться копия файла
// после чего мы укажем в параметре NewFilePath новый путь к файлу,
// а свойство Action выставим eaUseNewFilePathAndDel
// Таким образом мы уведомляем FWZip что нужно повторить попытку
// архивации файла, при этом необходимо использовать новый путь к файлу,
// после чего данный файл следует удалить.
Method.Code := @OnException1;
Method.Data := Writer;
Writer.OnException := TZipBuildExceptionEvent(Method);
Write('BuildWithException2.zip -> ');
ShowBuildResult(Writer.BuildZip('..\DemoResults\BuildWithException2.zip'));
{$IFDEF LINUX}
if hLockedFile = INVALID_HANDLE_VALUE then
hLockedFile := FileOpen(PathCanonicalize('..\..\' + Writer[0].FileName), WriteLock);
{$ENDIF}
// второй вариант, обработки показан в обработчике OnException2
// в нем мы снимаем исскуственную блокировку файла и выставляем
// свойство Action в eaRetry.
// Таким образом мы уведомляем FWZip что нужно повторить попытку
// архивации файла
Method.Code := @OnException2;
Method.Data := Writer;
Writer.OnException := TZipBuildExceptionEvent(Method);
Write('BuildWithException3.zip -> ');
ShowBuildResult(Writer.BuildZip('..\DemoResults\BuildWithException3.zip'));
// для демонстрации возвращаем блокировку на место
if hLockedFile = INVALID_HANDLE_VALUE then
hLockedFile := FileOpen(PathCanonicalize('..\..\' + Writer[0].FileName), WriteLock);
// третий вариант, обработки показан в обработчике OnException3
// в нем мы загружаем любым способом данные файла в стрим и
// выставляем свойство Action в eaUseNewFileData
// Таким образом данные будут браться непосредственно из стрима
// NewFileData
Method.Code := @OnException3;
Method.Data := Writer;
Writer.OnException := TZipBuildExceptionEvent(Method);
Write('BuildWithException4.zip -> ');
ShowBuildResult(Writer.BuildZip('..\DemoResults\BuildWithException4.zip'));
// ориентируясь на тип исключения можно реализовывать разнулю логику обработчика.
// если вы не знаете как обработать то или иное исключение,
// следует выставить свойство Action в eaSkip (выставлено по умолчанию)
// для того чтобы пропустить проблемный файл, или eaAbort,
// прервав таким образом создание архива.
finally
if hLockedFile <> INVALID_HANDLE_VALUE then
FileClose(hLockedFile);
end;
finally
Writer.Free;
end;
// При распаковке частой ошибочной ситуацией является попытка
// перезаписи уже существующего на диске файла, либо ошибка
// распаковки архива, созданного сторонним архиватором.
// Обработка ошибки распаковки решается использованием более
// новой версии ZLib (см. Readme.txt пункт 9)
// Возникновение ошибки по другим причинам приведет к возникновению
// события OnException. Если данное событие не перекрыто,
// то в случае вызова метода TFWZipReader.ExtractAll
// распаковка архива будет остановлена.
// В случае, если данное событие перекрыто, то решение
// о остановке распаковки должен принимать программист,
// выставлением флага Handled:
// (Handled = True, исключение обработано, можно продолжить распаковку)
// для демонстрации проэмулируем ошибку перезаписи,
// для этого нужно дважды распаковать один и тот-же архив
// в одну и ту-же папку
Reader := TFWZipReader.Create;
try
Reader.LoadFromFile('..\DemoResults\BuildWithException1.zip');
// распаковываем первый раз
Reader.ExtractAll('..\DemoResults\BuildWithExceptionUnpack\');
// теперь пробуем распаковать повторно.
// исключения в данном случае не произойдет, но все элементы будут пропущены
Reader.ExtractAll('..\DemoResults\BuildWithExceptionUnpack\');
// пропуск элементов можно увидеть и при ручной распаковке.
// т.к. вызов Reader[I].Extract в отличие от Reader.ExtractAll
// возвращает результат
Writeln('Manual extract:');
for I := 0 to Reader.Count - 1 do
ShowManualExtractResult(
string(Reader[I].FileName),
Reader[I].Extract('..\DemoResults\BuildWithExceptionUnpack\', ''));
// как можно заметить, все элементы действительно были пропущены
// (Reader[I].Extract вернул erSkiped для каждого элемента)
// Для обработки данной ситуации в режиме автоматической распаковки (ExtractAll)
// необходимо перекрыть событие OnDuplicate у класса TFWZipReader.
// В случае ручной распаковки, перекрывать событие OnDuplicate требуется
// у каждого элемента (Reader.Items[индекс элемента].OnDuplicate)
Method.Code := @OnDuplicate;
Method.Data := Reader;
Reader.OnDuplicate := TZipDuplicateEvent(Method);
// теперь попробуем повторно распаковать.
// при возникновении события OnDuplicate в обработчике элементу будет
// назначено новое имя и параметр Action будет выставлен в daUseNewFilePath.
// Таким образом мы укажем TFWZipReader-у что необходимо распаковать
// файл с новым именем...
// (т.е. получим аналог создания файлов в проводнике Windows, например:
// New folder -> New folder (2) -> New folder (3) и т.д.)
Reader.ExtractAll('..\DemoResults\BuildWithExceptionUnpack\');
finally
Reader.Free;
end;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.

View File

@@ -0,0 +1,152 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{D336C006-9204-4B8B-A8C2-88CAB9F2693C}</ProjectGuid>
<MainSource>BuildWithException.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>19.2</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_S>false</DCC_S>
<DCC_K>false</DCC_K>
<DCC_E>false</DCC_E>
<DCC_N>false</DCC_N>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=;CFBundleDisplayName=;UIDeviceFamily=;CFBundleIdentifier=;CFBundleVersion=;CFBundlePackageType=;CFBundleSignature=;CFBundleAllowMixedLocalizations=;UISupportedInterfaceOrientations=;CFBundleExecutable=;CFBundleResourceSpecification=;LSRequiresIPhoneOS=;CFBundleInfoDictionaryVersion=;CFBundleDevelopmentRegion=</VerInfo_Keys>
<DCC_F>false</DCC_F>
<VerInfo_Locale>1049</VerInfo_Locale>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace)</DCC_Namespace>
<DCC_ImageBase>00400000</DCC_ImageBase>
<SanitizedProjectName>BuildWithException</SanitizedProjectName>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_DebugInformation>0</DCC_DebugInformation>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<DCC_UnitSearchPath>../../;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<Manifest_File>(None)</Manifest_File>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">BuildWithException.dpr</Source>
</Source>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1049</VersionInfo>
<VersionInfo Name="CodePage">1251</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
<VersionInfoKeys Name="CFBundleName"/>
<VersionInfoKeys Name="CFBundleDisplayName"/>
<VersionInfoKeys Name="UIDeviceFamily"/>
<VersionInfoKeys Name="CFBundleIdentifier"/>
<VersionInfoKeys Name="CFBundleVersion"/>
<VersionInfoKeys Name="CFBundlePackageType"/>
<VersionInfoKeys Name="CFBundleSignature"/>
<VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
<VersionInfoKeys Name="UISupportedInterfaceOrientations"/>
<VersionInfoKeys Name="CFBundleExecutable"/>
<VersionInfoKeys Name="CFBundleResourceSpecification"/>
<VersionInfoKeys Name="LSRequiresIPhoneOS"/>
<VersionInfoKeys Name="CFBundleInfoDictionaryVersion"/>
<VersionInfoKeys Name="CFBundleDevelopmentRegion"/>
</VersionInfoKeys>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>

View File

@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="BuildWithException"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="LazUtils"/>
</Item>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="BuildWithException.dpr"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="..\DemoResults\MultyPartZip\ZIP\FWZipConsts.pas"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="..\DemoResults\MultyPartZip\ZIP\FWZipReader.pas"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="..\DemoResults\MultyPartZip\ZIP\FWZipWriter.pas"/>
<IsPartOfProject Value="True"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="..\..;$(ProjOutDir)"/>
<Libraries Value="..\..\fpc_lib"/>
<OtherUnitFiles Value="..\.."/>
<UnitOutputDirectory Value="."/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
</Linking>
<Other>
<CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,24 @@
rd /S /Q "%cd%\backup\"
rd /S /Q "%cd%\ConverterBackup\"
rd /S /Q "%cd%\lib\"
rd /S /Q "%cd%\__history\"
rd /S /Q "%cd%\__recovery\"
del "%cd%\*.o"
del "%cd%\*.a"
del "%cd%\*.or"
del "%cd%\*.lps"
del "%cd%\*.obj"
del "%cd%\*.exe"
del "%cd%\*.ppu"
del "%cd%\*.dcu"
del "%cd%\*.log"
del "%cd%\*.compiled"
del "%cd%\*.cfg"
del "%cd%\*.dof"
del "%cd%\*.dproj.local"
del "%cd%\*.identcache"
del "%cd%\*.dsk"
del "%cd%\*.skincfg"
del "%cd%\*.bak"
del "%cd%\*.rsm"
del "%cd%\*.~*"

View File

@@ -0,0 +1,223 @@
////////////////////////////////////////////////////////////////////////////////
//
// ****************************************************************************
// * Project : FWZip
// * Unit Name : UseExDataBlob
// * Purpose : Демонстрация работы с блоками ExData
// * Author : Александр (Rouse_) Багель
// * Copyright : © Fangorn Wizards Lab 1998 - 2023.
// * Version : 2.0.0
// * Home Page : http://rouse.drkb.ru
// * Home Blog : http://alexander-bagel.blogspot.ru
// ****************************************************************************
// * Stable Release : http://rouse.drkb.ru/components.php#fwzip
// * Latest Source : https://github.com/AlexanderBagel/FWZip
// ****************************************************************************
//
// Используемые источники:
// ftp://ftp.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
// https://zlib.net/zlib-1.2.13.tar.gz
// http://www.base2ti.com/
//
// Данный пример показывает работу с блоками ExData.
// Их добавление при создании архива и извлечение.
// Данные блоки могут содержать любые дополнительные параметры связанные
// с элементом архива. Список зарезервированных блоков см. в коментарии
// обработчика OnSaveExData.
program UseExDataBlob;
{$IFDEF FPC}
{$MODE Delphi}
{$H+}
{$ELSE}
{$APPTYPE CONSOLE}
{$ENDIF}
uses
SysUtils,
Classes,
FWZipWriter,
FWZipReader,
FWZipConsts;
const
TestExDataBlob: Cardinal = $DEADBEEF;
var
Writer: TFWZipWriter;
Reader: TFWZipReader;
Method: TMethod;
//
// Обработчик при помощи которого мы добавляем блок расширенных данных ExData
// к каждому элементу массива
// =============================================================================
procedure OnSaveExData({%H-}Self, Sender: TObject; {%H-}ItemIndex: Integer;
UserExDataBlockCount: Integer; var Tag: Word; Data: TStream);
var
RandomValue: Cardinal;
begin
// При добавлении блока расширенных данных следует указать его Тэг и
// записать сами данные в стрим Data, при этом размер Data не может
// превысить значение MAXWORD а значение Тэг должно быть отлично от нуля.
// Данный обработчик будет вызываться до тех пор, пока вы не укажете
// что более блоков данных нет. Для этого нужно не заполнять стрим Data.
// Количество вызовов обработчика для текущего элемента можно узнать по
// переменной UserExDataBlockCount
// Обратите внимание, следующие значения тэгов зарезервированы:
{
The current Header ID mappings defined by PKWARE are:
0x0001 ZIP64 extended information extra field
0x0007 AV Info
0x0008 Reserved for future Unicode file name data (PFS)
0x0009 OS/2 extended attributes (also Info-ZIP)
0x000a NTFS (Win9x/WinNT FileTimes)
0x000c OpenVMS (also Info-ZIP)
0x000d Unix
0x000e Reserved for file stream and fork descriptors
0x000f Patch Descriptor
0x0014 PKCS#7 Store for X.509 Certificates
0x0015 X.509 Certificate ID and Signature for
individual file
0x0016 X.509 Certificate ID for Central Directory
0x0017 Strong Encryption Header
0x0018 Record Management Controls
0x0019 PKCS#7 Encryption Recipient Certificate List
0x0065 IBM S/390 (Z390), AS/400 (I400) attributes
- uncompressed
0x0066 Reserved for IBM S/390 (Z390), AS/400 (I400)
attributes - compressed
The Header ID mappings defined by Info-ZIP and third parties are:
0x07c8 Info-ZIP Macintosh (old, J. Lee)
0x2605 ZipIt Macintosh (first version)
0x2705 ZipIt Macintosh v 1.3.5 and newer (w/o full filename)
0x2805 ZipIt Macintosh 1.3.5+
0x334d Info-ZIP Macintosh (new, D. Haase's 'Mac3' field)
0x4154 Tandem NSK
0x4341 Acorn/SparkFS (David Pilling)
0x4453 Windows NT security descriptor (binary ACL)
0x4704 VM/CMS
0x470f MVS
0x4854 Theos, old inofficial port
0x4b46 FWKCS MD5 (see below)
0x4c41 OS/2 access control list (text ACL)
0x4d49 Info-ZIP OpenVMS (obsolete)
0x4d63 Macintosh SmartZIP, by Macro Bambini
0x4f4c Xceed original location extra field
0x5356 AOS/VS (binary ACL)
0x5455 extended timestamp
0x554e Xceed unicode extra field
0x5855 Info-ZIP Unix (original; also OS/2, NT, etc.)
0x6542 BeOS (BeBox, PowerMac, etc.)
0x6854 Theos
0x7441 AtheOS (AtheOS/Syllable attributes)
0x756e ASi Unix
0x7855 Info-ZIP Unix (new)
0xfb4a SMS/QDOS
}
// Для примера мы заполним три блока данных:
case UserExDataBlockCount of
0:
begin
// Выбираем незарезервированное значение тэга (например $FFFA)
Tag := $FFFA;
// и пишем сами данные
Data.WriteBuffer(TestExDataBlob, 4);
end;
1..2:
begin
// Выбираем другое незарезервированное значение тэга
Tag := $FFFB + UserExDataBlockCount;
// данные рандомные - просто для демонстрации записи двух и более полей
Randomize;
RandomValue := Random(MaxInt);
Data.WriteBuffer(RandomValue, 4);
end;
end;
end;
//
// Обработчик при помощи которого мы получаем блок расширенных данных ExData
// который не смог обработать TFWZipReader.
// Обработчик вызывается для каждого нераспознанного элемента ExData,
// количество которых не ограничено.
// Данный обработчик вызывается при вызове метода TFWZipReader.LoadFromFile
// Sender в данном обработчике является TFWZipReaderItem,
// т.е. элементом при чтении которого не распознался тэг ExData.
// =============================================================================
procedure OnLoadExData({%H-}Self, Sender: TObject; {%H-}ItemIndex: Integer;
Tag: Word; Data: TStream);
var
Value: Cardinal;
begin
// так как мы знаем как нужно обрабатывать только блок данных с тэгом $FFFA
// то остальные необходимо пропустить
if Tag = $FFFA then
begin
// Для демонстрации просто проверяем совпадает ли значение в блоке с нашим
if Data.Size <> 4 then
raise Exception.Create('Неверный размер блока ExData');
Value := 0;
Data.ReadBuffer(Value, Data.Size);
if Value <> TestExDataBlob then
raise Exception.Create('Неверное значение блока ExData');
// связать данные с элементом массива можно например используя поле Tag
TFWZipReaderItem(Sender).Tag := Integer(Value);
// вот такой вызов делать нельзя, т.к. в данный момент Sender
// находится в конструкторе и не добавлен в список элементов
// главного класса
// Reader[ItemIndex].Tag := Integer(Value); - ошибочный код
end;
end;
begin
SetCurrentDir(ExtractFilePath(ParamStr(0)));
try
Writer := TFWZipWriter.Create;
try
// Для начала добавим в корень архива файлы из корневой директории
Writer.AddFolder('', '..\..\', '*.*', False);
// Назначаем обработчик через который мы будем добавлять блок расширенных данных
Method.Code := @OnSaveExData;
Method.Data := Writer;
Writer.OnSaveExData := TZipSaveExDataEvent(Method);
// Сохраняем результат
Writer.BuildZip('..\DemoResults\UseExDataBlob.zip');
finally
Writer.Free;
end;
Reader := TFWZipReader.Create;
try
// Теперь наша задача получить расширенные блоки данных.
// Для этого необходимо назначить обработчик OnLoadExData
// и открыть сам архив.
Method.Code := @OnLoadExData;
Method.Data := Reader;
Reader.OnLoadExData := TZipLoadExDataEvent(Method);
Reader.LoadFromFile('..\DemoResults\UseExDataBlob.zip');
finally
Reader.Free;
end;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.

View File

@@ -0,0 +1,152 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{02A43576-9D18-4FA2-9764-51DAB3B92B77}</ProjectGuid>
<MainSource>UseExDataBlob.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>19.2</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_S>false</DCC_S>
<DCC_K>false</DCC_K>
<DCC_E>false</DCC_E>
<DCC_N>false</DCC_N>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=;CFBundleDisplayName=;UIDeviceFamily=;CFBundleIdentifier=;CFBundleVersion=;CFBundlePackageType=;CFBundleSignature=;CFBundleAllowMixedLocalizations=;UISupportedInterfaceOrientations=;CFBundleExecutable=;CFBundleResourceSpecification=;LSRequiresIPhoneOS=;CFBundleInfoDictionaryVersion=;CFBundleDevelopmentRegion=</VerInfo_Keys>
<DCC_F>false</DCC_F>
<VerInfo_Locale>1049</VerInfo_Locale>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<DCC_ImageBase>00400000</DCC_ImageBase>
<SanitizedProjectName>UseExDataBlob</SanitizedProjectName>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_DebugInformation>0</DCC_DebugInformation>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<Manifest_File>(None)</Manifest_File>
<DCC_UnitSearchPath>../../;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">UseExDataBlob.dpr</Source>
</Source>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1049</VersionInfo>
<VersionInfo Name="CodePage">1251</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
<VersionInfoKeys Name="CFBundleName"/>
<VersionInfoKeys Name="CFBundleDisplayName"/>
<VersionInfoKeys Name="UIDeviceFamily"/>
<VersionInfoKeys Name="CFBundleIdentifier"/>
<VersionInfoKeys Name="CFBundleVersion"/>
<VersionInfoKeys Name="CFBundlePackageType"/>
<VersionInfoKeys Name="CFBundleSignature"/>
<VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
<VersionInfoKeys Name="UISupportedInterfaceOrientations"/>
<VersionInfoKeys Name="CFBundleExecutable"/>
<VersionInfoKeys Name="CFBundleResourceSpecification"/>
<VersionInfoKeys Name="LSRequiresIPhoneOS"/>
<VersionInfoKeys Name="CFBundleInfoDictionaryVersion"/>
<VersionInfoKeys Name="CFBundleDevelopmentRegion"/>
</VersionInfoKeys>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>

View File

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="UseExDataBlob"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="UseExDataBlob.dpr"/>
<IsPartOfProject Value="True"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="..\..;$(ProjOutDir)"/>
<Libraries Value="..\..\fpc_lib"/>
<OtherUnitFiles Value="..\.."/>
<UnitOutputDirectory Value="."/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
</Linking>
<Other>
<CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,24 @@
rd /S /Q "%cd%\backup\"
rd /S /Q "%cd%\ConverterBackup\"
rd /S /Q "%cd%\lib\"
rd /S /Q "%cd%\__history\"
rd /S /Q "%cd%\__recovery\"
del "%cd%\*.o"
del "%cd%\*.a"
del "%cd%\*.or"
del "%cd%\*.lps"
del "%cd%\*.obj"
del "%cd%\*.exe"
del "%cd%\*.ppu"
del "%cd%\*.dcu"
del "%cd%\*.log"
del "%cd%\*.compiled"
del "%cd%\*.cfg"
del "%cd%\*.dof"
del "%cd%\*.dproj.local"
del "%cd%\*.identcache"
del "%cd%\*.dsk"
del "%cd%\*.skincfg"
del "%cd%\*.bak"
del "%cd%\*.rsm"
del "%cd%\*.~*"

View File

@@ -0,0 +1,23 @@
program ZipAnalizer;
{$IFDEF FPC}
{$MODE Delphi}
{$ENDIF}
uses
{$IFnDEF FPC}
{$ELSE}
Interfaces,
{$ENDIF}
Forms,
uZipAnalizer in 'uZipAnalizer.pas' {dlgZipAnalizer};
{$IFNDEF FPC}
{$R *.res}
{$ENDIF}
begin
Application.Initialize;
Application.CreateForm(TdlgZipAnalizer, dlgZipAnalizer);
Application.Run;
end.

View File

@@ -0,0 +1,173 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{48B210D8-1C88-400C-8596-80BA4942AF52}</ProjectGuid>
<MainSource>ZipAnalizer.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Application</AppType>
<FrameworkType>VCL</FrameworkType>
<ProjectVersion>19.2</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
<Base_Win64>true</Base_Win64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_N>false</DCC_N>
<DCC_ImageBase>00400000</DCC_ImageBase>
<DCC_E>false</DCC_E>
<VerInfo_Locale>1049</VerInfo_Locale>
<DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace)</DCC_Namespace>
<DCC_F>false</DCC_F>
<DCC_K>false</DCC_K>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=;CFBundleDisplayName=;UIDeviceFamily=;CFBundleIdentifier=;CFBundleVersion=;CFBundlePackageType=;CFBundleSignature=;CFBundleAllowMixedLocalizations=;UISupportedInterfaceOrientations=;CFBundleExecutable=;CFBundleResourceSpecification=;LSRequiresIPhoneOS=;CFBundleInfoDictionaryVersion=;CFBundleDevelopmentRegion=</VerInfo_Keys>
<DCC_S>false</DCC_S>
<SanitizedProjectName>ZipAnalizer</SanitizedProjectName>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Locale>1033</VerInfo_Locale>
<Icon_MainIcon>ZipAnalizer_Icon.ico</Icon_MainIcon>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<Icon_MainIcon>ZipAnalizer_Icon.ico</Icon_MainIcon>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_DebugInformation>0</DCC_DebugInformation>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<BT_BuildType>Debug</BT_BuildType>
<DCC_UnitSearchPath>../../;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="uZipAnalizer.pas">
<Form>dlgZipAnalizer</Form>
</DCCReference>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">ZipAnalizer.dpr</Source>
</Source>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1049</VersionInfo>
<VersionInfo Name="CodePage">1251</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
<VersionInfoKeys Name="CFBundleName"/>
<VersionInfoKeys Name="CFBundleDisplayName"/>
<VersionInfoKeys Name="UIDeviceFamily"/>
<VersionInfoKeys Name="CFBundleIdentifier"/>
<VersionInfoKeys Name="CFBundleVersion"/>
<VersionInfoKeys Name="CFBundlePackageType"/>
<VersionInfoKeys Name="CFBundleSignature"/>
<VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
<VersionInfoKeys Name="UISupportedInterfaceOrientations"/>
<VersionInfoKeys Name="CFBundleExecutable"/>
<VersionInfoKeys Name="CFBundleResourceSpecification"/>
<VersionInfoKeys Name="LSRequiresIPhoneOS"/>
<VersionInfoKeys Name="CFBundleInfoDictionaryVersion"/>
<VersionInfoKeys Name="CFBundleDevelopmentRegion"/>
</VersionInfoKeys>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

View File

@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="ZipAnalizer"/>
<Scaled Value="True"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<DpiAware Value="True/PM_V2"/>
<UIAccess Value="True"/>
<LongPathAware Value="True"/>
</XPManifest>
<Icon Value="0"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="ZipAnalizer.dpr"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="uZipAnalizer.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="dlgZipAnalizer"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="..\..;$(ProjOutDir)"/>
<Libraries Value="..\..\fpc_lib"/>
<OtherUnitFiles Value="..\.."/>
<UnitOutputDirectory Value="."/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 KiB

View File

@@ -0,0 +1,24 @@
rd /S /Q "%cd%\backup\"
rd /S /Q "%cd%\ConverterBackup\"
rd /S /Q "%cd%\lib\"
rd /S /Q "%cd%\__history\"
rd /S /Q "%cd%\__recovery\"
del "%cd%\*.o"
del "%cd%\*.a"
del "%cd%\*.or"
del "%cd%\*.lps"
del "%cd%\*.obj"
del "%cd%\*.exe"
del "%cd%\*.ppu"
del "%cd%\*.dcu"
del "%cd%\*.log"
del "%cd%\*.compiled"
del "%cd%\*.cfg"
del "%cd%\*.dof"
del "%cd%\*.dproj.local"
del "%cd%\*.identcache"
del "%cd%\*.dsk"
del "%cd%\*.skincfg"
del "%cd%\*.bak"
del "%cd%\*.rsm"
del "%cd%\*.~*"

View File

@@ -0,0 +1,104 @@
object dlgZipAnalizer: TdlgZipAnalizer
Left = 301
Top = 184
Caption = #1042#1099#1074#1086#1076' '#1087#1072#1088#1072#1084#1077#1090#1088#1086#1074' ZIP '#1072#1088#1093#1080#1074#1072
ClientHeight = 300
ClientWidth = 685
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
OnCreate = FormCreate
OnDestroy = FormDestroy
DesignSize = (
685
300)
PixelsPerInch = 96
TextHeight = 13
object edPath: TLabeledEdit
Left = 8
Top = 24
Width = 550
Height = 21
Anchors = [akLeft, akTop, akRight]
EditLabel.Width = 124
EditLabel.Height = 13
EditLabel.Caption = #1059#1082#1072#1078#1080#1090#1077' '#1087#1091#1090#1100' '#1082' '#1072#1088#1093#1080#1074#1091':'
TabOrder = 0
OnChange = edPathChange
end
object btnBrowse: TButton
Left = 560
Top = 22
Width = 25
Height = 25
Anchors = [akTop, akRight]
Caption = '...'
TabOrder = 1
OnClick = btnBrowseClick
end
object btnAnalize: TButton
Left = 589
Top = 22
Width = 75
Height = 25
Anchors = [akTop, akRight]
Caption = #1057#1090#1072#1088#1090
Enabled = False
TabOrder = 2
OnClick = btnAnalizeClick
end
object GroupBox: TGroupBox
Left = 8
Top = 56
Width = 669
Height = 233
Anchors = [akLeft, akTop, akRight, akBottom]
Caption = #1055#1072#1088#1072#1084#1077#1090#1088#1099' '#1072#1088#1093#1080#1074#1072':'
TabOrder = 3
object edReport: TMemo
Left = 2
Top = 15
Width = 665
Height = 216
Align = alClient
Font.Charset = RUSSIAN_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
PopupMenu = PopupMenu
ReadOnly = True
ScrollBars = ssBoth
TabOrder = 0
end
end
object OpenDialog: TOpenDialog
DefaultExt = 'zip'
Filter = 'ZIP '#1072#1088#1093#1080#1074#1099' (*.zip)|*.zip|'#1042#1089#1077' '#1092#1072#1081#1083#1099' (*.*)|*.*'
Options = [ofHideReadOnly, ofFileMustExist, ofEnableSizing]
Left = 48
Top = 88
end
object PopupMenu: TPopupMenu
OnPopup = PopupMenuPopup
Left = 120
Top = 88
object mnuSave: TMenuItem
Caption = #1057#1086#1093#1088#1072#1085#1080#1090#1100'...'
ShortCut = 16467
OnClick = mnuSaveClick
end
end
object SaveDialog: TSaveDialog
DefaultExt = 'txt'
Filter = #1058#1077#1082#1089#1090#1086#1074#1099#1077' '#1092#1072#1081#1083#1099' (*.txt)|*.txt|'#1042#1089#1077' '#1092#1072#1081#1083#1099' (*.*)|*.*'
Left = 208
Top = 88
end
end

View File

@@ -0,0 +1,102 @@
object dlgZipAnalizer: TdlgZipAnalizer
Left = 1082
Height = 341
Top = 637
Width = 728
Caption = 'Вывод параметров ZIP архива'
ClientHeight = 341
ClientWidth = 728
Color = clBtnFace
DesignTimePPI = 144
Font.Color = clWindowText
Font.Height = -17
Font.Name = 'Tahoma'
OnCreate = FormCreate
OnDestroy = FormDestroy
Position = poScreenCenter
LCLVersion = '2.2.6.0'
object edPath: TLabeledEdit
Left = 12
Height = 29
Top = 36
Width = 526
Anchors = [akTop, akLeft, akRight]
EditLabel.Height = 21
EditLabel.Width = 526
EditLabel.Caption = 'Укажите путь к архиву:'
EditLabel.ParentColor = False
TabOrder = 0
OnChange = edPathChange
end
object btnBrowse: TButton
Left = 540
Height = 38
Top = 30
Width = 38
Anchors = [akTop, akRight]
Caption = '...'
OnClick = btnBrowseClick
TabOrder = 1
end
object btnAnalize: TButton
Left = 588
Height = 38
Top = 30
Width = 112
Anchors = [akTop, akRight]
Caption = 'Старт'
Enabled = False
OnClick = btnAnalizeClick
TabOrder = 2
end
object GroupBox: TGroupBox
Left = 12
Height = 241
Top = 84
Width = 704
Anchors = [akTop, akLeft, akRight, akBottom]
Caption = 'Параметры архива:'
ClientHeight = 215
ClientWidth = 700
TabOrder = 3
object edReport: TMemo
Left = 0
Height = 215
Top = 0
Width = 700
Align = alClient
Font.CharSet = RUSSIAN_CHARSET
Font.Color = clWindowText
Font.Height = -17
Font.Name = 'Tahoma'
ParentFont = False
PopupMenu = PopupMenu
ReadOnly = True
ScrollBars = ssBoth
TabOrder = 0
end
end
object OpenDialog: TOpenDialog
DefaultExt = '.zip'
Filter = 'ZIP архивы (*.zip)|*.zip|Все файлы (*.*)|*.*'
Options = [ofHideReadOnly, ofFileMustExist, ofEnableSizing]
Left = 72
Top = 132
end
object PopupMenu: TPopupMenu
OnPopup = PopupMenuPopup
Left = 180
Top = 132
object mnuSave: TMenuItem
Caption = 'Сохранить...'
ShortCut = 16467
OnClick = mnuSaveClick
end
end
object SaveDialog: TSaveDialog
DefaultExt = '.txt'
Filter = 'Текстовые файлы (*.txt)|*.txt|Все файлы (*.*)|*.*'
Left = 312
Top = 132
end
end

View File

@@ -0,0 +1,372 @@
////////////////////////////////////////////////////////////////////////////////
//
// ****************************************************************************
// * Project : FWZip - ZipAnalizer
// * Unit Name : uZipAnalizer
// * Purpose : Вывод параметров архива используя возможности FWZipReader
// * Author : Александр (Rouse_) Багель
// * Copyright : © Fangorn Wizards Lab 1998 - 2023.
// * Version : 2.0.0
// * Home Page : http://rouse.drkb.ru
// * Home Blog : http://alexander-bagel.blogspot.ru
// ****************************************************************************
// * Stable Release : http://rouse.drkb.ru/components.php#fwzip
// * Latest Source : https://github.com/AlexanderBagel/FWZip
// ****************************************************************************
//
// Используемые источники:
// ftp://ftp.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
// https://zlib.net/zlib-1.2.13.tar.gz
// http://www.base2ti.com/
//
unit uZipAnalizer;
{$IFDEF FPC}
{$MODE Delphi}
{$ENDIF}
interface
uses
{$IFnDEF FPC}
Windows,
{$ELSE}
LCLIntf, LCLType,
{$ENDIF}
SysUtils, Classes, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, ExtCtrls, Menus,
FWZipReader,
FWZipConsts,
FWZipUtils;
type
TFWZipReaderFriendly = class(TFWZipReader);
TFWZipReaderItemFriendly = class(TFWZipReaderItem);
TExDataRecord = record
Index: Integer;
Tag: Word;
Stream: TMemoryStream;
end;
TExDataRecords = array of TExDataRecord;
TdlgZipAnalizer = class(TForm)
edPath: TLabeledEdit;
btnBrowse: TButton;
btnAnalize: TButton;
GroupBox: TGroupBox;
edReport: TMemo;
OpenDialog: TOpenDialog;
PopupMenu: TPopupMenu;
mnuSave: TMenuItem;
SaveDialog: TSaveDialog;
procedure btnBrowseClick(Sender: TObject);
procedure edPathChange(Sender: TObject);
procedure btnAnalizeClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure mnuSaveClick(Sender: TObject);
procedure PopupMenuPopup(Sender: TObject);
private
ExDataRecords: TExDataRecords;
Zip: TFWZipReaderFriendly;
procedure OnLoadExData(Sender: TObject; ItemIndex: Integer;
Tag: Word; Data: TStream);
private
procedure ClearExData;
procedure Log(const Value: string);
procedure ShowEndOfCentralDir;
procedure ShowZip64EOFCentralDirectoryLocator;
procedure ShowZip64EOFCentralDirectoryRecord;
procedure ShowItemData(Index: Integer);
end;
var
dlgZipAnalizer: TdlgZipAnalizer;
implementation
const
Delim = '===================================================================';
{$IFnDEF FPC}
{$R *.dfm}
{$ELSE}
{$R *.lfm}
{$ENDIF}
procedure TdlgZipAnalizer.btnAnalizeClick(Sender: TObject);
var
I: Integer;
begin
edReport.Lines.BeginUpdate;
try
edReport.Clear;
Log(edPath.Text);
Log(Delim);
ClearExData;
Zip.Clear;
Zip.LoadFromFile(edPath.Text);
ShowEndOfCentralDir;
ShowZip64EOFCentralDirectoryLocator;
ShowZip64EOFCentralDirectoryRecord;
for I := 0 to Zip.Count - 1 do
ShowItemData(I);
Log('DONE');
finally
edReport.Lines.EndUpdate;
end;
end;
procedure TdlgZipAnalizer.btnBrowseClick(Sender: TObject);
begin
UseLongNamePrefix := False;
OpenDialog.InitialDir :=
PathCanonicalize(ExtractFilePath(ParamStr(0)) + '..\DemoResults');
if OpenDialog.Execute then
begin
edPath.Text := OpenDialog.FileName;
edReport.Clear;
end;
end;
procedure TdlgZipAnalizer.ClearExData;
var
I: Integer;
begin
for I := 0 to Length(ExDataRecords) - 1 do
ExDataRecords[I].Stream.Free;
SetLength(ExDataRecords, 0);;
end;
procedure TdlgZipAnalizer.edPathChange(Sender: TObject);
begin
btnAnalize.Enabled := FileExists(edPath.Text);
end;
procedure TdlgZipAnalizer.FormCreate(Sender: TObject);
begin
Zip := TFWZipReaderFriendly.Create;
Zip.OnLoadExData := OnLoadExData;
end;
procedure TdlgZipAnalizer.FormDestroy(Sender: TObject);
begin
ClearExData;
Zip.Free;
end;
procedure TdlgZipAnalizer.Log(const Value: string);
begin
edReport.Lines.Add(Value);
end;
procedure TdlgZipAnalizer.mnuSaveClick(Sender: TObject);
begin
if SaveDialog.Execute then
edReport.Lines.SaveToFile(SaveDialog.FileName);
end;
procedure TdlgZipAnalizer.OnLoadExData(Sender: TObject; ItemIndex: Integer;
Tag: Word; Data: TStream);
var
Count: Integer;
begin
Count := Length(ExDataRecords);
SetLength(ExDataRecords, Count + 1);
ExDataRecords[Count].Index := ItemIndex;
ExDataRecords[Count].Tag := Tag;
ExDataRecords[Count].Stream := TMemoryStream.Create;
ExDataRecords[Count].Stream.CopyFrom(Data, 0);
end;
procedure TdlgZipAnalizer.PopupMenuPopup(Sender: TObject);
begin
mnuSave.Enabled := edReport.Lines.Count > 1;
end;
procedure TdlgZipAnalizer.ShowEndOfCentralDir;
begin
Log('END_OF_CENTRAL_DIR_SIGNATURE found');
with Zip.EndOfCentralDir do
begin
Log(Format('NumberOfThisDisk: %d', [NumberOfThisDisk]));
Log(Format('NumberOfTheDiskWithTheStart: %d', [DiskNumberStart]));
Log(Format('TotalNumberOfEntriesOnThisDisk: %d', [TotalNumberOfEntriesOnThisDisk]));
Log(Format('TotalNumberOfEntries: %d', [TotalNumberOfEntries]));
Log(Format('SizeOfTheCentralDirectory: %d', [SizeOfTheCentralDirectory]));
Log(Format('OffsetOfStartOfCentralDirectory: %d', [RelativeOffsetOfCentralDirectory]));
Log(Format('ZipfileCommentLength: %d', [ZipfileCommentLength]));
if ZipfileCommentLength > 0 then
Log(Format('Comment: %s', [Zip.Comment]));
end;
Log(Delim);
end;
procedure TdlgZipAnalizer.ShowItemData(Index: Integer);
function ByteToStr(Bytes: PByte; Size: Integer): string;
const
BytesHex: array[0..15] of char =
('0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F');
var
I: integer;
begin
{$IFDEF FPC}
Result := '';
{$ENDIF}
SetLength(Result, Size shl 1);
for I := 0 to Size - 1 do
begin
Result[I * 2 + 1] := BytesHex[Bytes^ shr 4];
Result[I * 2 + 2] := BytesHex[Bytes^ and $0F];
Inc(Bytes);
end;
end;
function GPBFToStr(Value: Word): string;
procedure AddValue(const S: string);
begin
if Result = '' then
Result := S
else
Result := Result + ', ' + S;
end;
begin
if Value = 0 then
begin
Result := 'EMPTY';
Exit;
end;
if PBF_CRYPTED and Value <> 0 then
AddValue('PBF_CRYPTED');
if PBF_DESCRIPTOR and Value <> 0 then
AddValue('PBF_DESCRIPTOR');
if PBF_UTF8 and Value <> 0 then
AddValue('PBF_UTF8');
if PBF_STRONG_CRYPT and Value <> 0 then
AddValue('PBF_STRONG_CRYPT');
end;
var
I: Integer;
Item: TFWZipReaderItemFriendly;
begin
Log('CENTRAL_FILE_HEADER_SIGNATURE found');
Item := TFWZipReaderItemFriendly(Zip.Item[Index]);
with Item.CentralDirFileHeader do
begin
Log(Format('VersionMadeBy: %d', [VersionMadeBy]));
Log(Format('VersionNeededToExtract: %d', [VersionNeededToExtract]));
Log(Format('GeneralPurposeBitFlag: %d (%s)', [GeneralPurposeBitFlag,
GPBFToStr(GeneralPurposeBitFlag)]));
Log(Format('CompressionMethod: %d', [CompressionMethod]));
Log(Format('LastModFileTimeTime: %d', [LastModFileTimeTime]));
Log(Format('LastModFileTimeDate: %d', [LastModFileTimeDate]));
Log(Format('Crc32: %d', [Crc32]));
Log(Format('CompressedSize: %d', [CompressedSize]));
Log(Format('UncompressedSize: %d', [UncompressedSize]));
Log(Format('FilenameLength: %d', [FilenameLength]));
if FilenameLength > 0 then
Log('>>> FileName: ' + Item.FileName);
Log(Format('ExtraFieldLength: %d', [ExtraFieldLength]));
Log(Format('FileCommentLength: %d', [FileCommentLength]));
if FileCommentLength > 0 then
Log('>>> FileComment: ' + Item.Comment);
Log(Format('DiskNumberStart: %d', [DiskNumberStart]));
Log(Format('InternalFileAttributes: %d', [InternalFileAttributes]));
Log(Format('ExternalFileAttributes: %d', [ExternalFileAttributes]));
Log(Format('RelativeOffsetOfLocalHeader: %d', [RelativeOffsetOfLocalHeader]));
end;
Log('');
Item.LoadLocalFileHeader;
Log('LOCAL_FILE_HEADER_SIGNATURE found');
with Item.LocalFileHeader do
begin
Log(Format('VersionNeededToExtract: %d', [VersionNeededToExtract]));
Log(Format('GeneralPurposeBitFlag: %d (%s)', [GeneralPurposeBitFlag,
GPBFToStr(GeneralPurposeBitFlag)]));
Log(Format('CompressionMethod: %d', [CompressionMethod]));
Log(Format('LastModFileTimeTime: %d', [LastModFileTimeTime]));
Log(Format('LastModFileTimeDate: %d', [LastModFileTimeDate]));
Log(Format('Crc32: %d', [Crc32]));
Log(Format('CompressedSize: %d', [CompressedSize]));
Log(Format('UncompressedSize: %d', [UncompressedSize]));
Log(Format('FilenameLength: %d', [FilenameLength]));
Log(Format('ExtraFieldLength: %d', [ExtraFieldLength]));
end;
if ssZIP64 in Item.PresentStreams then
begin
Log('');
Log('SUPPORTED_EXDATA_ZIP64 found');
with Item do
begin
Log(Format('UncompressedSize: %d', [UncompressedSize]));
Log(Format('CompressedSize: %d', [CompressedSize]));
Log(Format('RelativeOffsetOfLocalHeader: %d', [RelativeOffsetOfLocalHeader]));
Log(Format('DiskNumberStart: %d', [DiskNumberStart]));
end;
end;
if ssNTFS in Item.PresentStreams then
begin
Log('');
Log('SUPPORTED_EXDATA_NTFSTIME found');
end;
for I := 0 to Length(ExDataRecords) - 1 do
if ExDataRecords[I].Index = Index then
begin
Log('');
Log(Format('UNKNOWN TAG (%d) found', [ExDataRecords[I].Tag]));
Log(Format('ExData size %d', [ExDataRecords[I].Stream.Size]));
Log('ExData dump:');
Log(ByteToStr(ExDataRecords[I].Stream.Memory, ExDataRecords[I].Stream.Size));
end;
Log(Delim);
end;
procedure TdlgZipAnalizer.ShowZip64EOFCentralDirectoryLocator;
begin
with Zip.Zip64EOFCentralDirectoryLocator do
begin
if Signature <> ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE then Exit;
Log('ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE found');
Log(Format('NumberOfTheDisk: %d', [DiskNumberStart]));
Log(Format('RelativeOffset: %d', [RelativeOffset]));
Log(Format('TotalNumberOfDisks: %d', [TotalNumberOfDisks]));
end;
Log(Delim);
end;
procedure TdlgZipAnalizer.ShowZip64EOFCentralDirectoryRecord;
begin
with Zip.Zip64EOFCentralDirectoryRecord do
begin
if Zip64EndOfCentralDirSignature <> ZIP64_END_OF_CENTRAL_DIR_SIGNATURE then Exit;
Log('ZIP64_END_OF_CENTRAL_DIR_SIGNATURE found');
Log(Format('SizeOfZip64EOFCentralDirectoryRecord: %d', [SizeOfZip64EOFCentralDirectoryRecord]));
Log(Format('VersionMadeBy: %d', [VersionMadeBy]));
Log(Format('VersionNeededToExtract: %d', [VersionNeededToExtract]));
Log(Format('number of this disk: %d', [NumberOfThisDisk]));
Log(Format('number of the disk with the start of the central directory: %d', [DiskNumberStart]));
Log(Format('total number of entries in the central directory on this disk: %d', [TotalNumberOfEntriesOnThisDisk]));
Log(Format('total number of entries in the central directory: %d', [TotalNumberOfEntries]));
Log(Format('size of the central directory: %d', [SizeOfTheCentralDirectory]));
Log(Format('offset of start of central directory with respect to the starting disk number: %d', [RelativeOffsetOfCentralDirectory]));
end;
Log(Delim);
end;
end.

View File

@@ -0,0 +1,23 @@
program ZipAnalizer2;
{$IFDEF FPC}
{$MODE Delphi}
{$ENDIF}
uses
{$IFnDEF FPC}
{$ELSE}
Interfaces,
{$ENDIF}
Forms,
uZipAnalizer2 in 'uZipAnalizer2.pas' {dlgZipAnalizer};
{$IFNDEF FPC}
{$R *.res}
{$ENDIF}
begin
Application.Initialize;
Application.CreateForm(TdlgZipAnalizer, dlgZipAnalizer);
Application.Run;
end.

View File

@@ -0,0 +1,173 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{59E61B6B-6187-41F8-947A-693BE9101356}</ProjectGuid>
<MainSource>ZipAnalizer2.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Application</AppType>
<FrameworkType>VCL</FrameworkType>
<ProjectVersion>19.2</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
<Base_Win64>true</Base_Win64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_N>false</DCC_N>
<DCC_ImageBase>00400000</DCC_ImageBase>
<DCC_E>false</DCC_E>
<VerInfo_Locale>1049</VerInfo_Locale>
<DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace)</DCC_Namespace>
<DCC_F>false</DCC_F>
<DCC_K>false</DCC_K>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=;CFBundleDisplayName=;UIDeviceFamily=;CFBundleIdentifier=;CFBundleVersion=;CFBundlePackageType=;CFBundleSignature=;CFBundleAllowMixedLocalizations=;UISupportedInterfaceOrientations=;CFBundleExecutable=;CFBundleResourceSpecification=;LSRequiresIPhoneOS=;CFBundleInfoDictionaryVersion=;CFBundleDevelopmentRegion=</VerInfo_Keys>
<DCC_S>false</DCC_S>
<SanitizedProjectName>ZipAnalizer2</SanitizedProjectName>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Locale>1033</VerInfo_Locale>
<Icon_MainIcon>ZipAnalizer_Icon.ico</Icon_MainIcon>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<Icon_MainIcon>ZipAnalizer_Icon.ico</Icon_MainIcon>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_DebugInformation>0</DCC_DebugInformation>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<BT_BuildType>Debug</BT_BuildType>
<DCC_UnitSearchPath>../../;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="uZipAnalizer2.pas">
<Form>dlgZipAnalizer</Form>
</DCCReference>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">ZipAnalizer2.dpr</Source>
</Source>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1049</VersionInfo>
<VersionInfo Name="CodePage">1251</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
<VersionInfoKeys Name="CFBundleName"/>
<VersionInfoKeys Name="CFBundleDisplayName"/>
<VersionInfoKeys Name="UIDeviceFamily"/>
<VersionInfoKeys Name="CFBundleIdentifier"/>
<VersionInfoKeys Name="CFBundleVersion"/>
<VersionInfoKeys Name="CFBundlePackageType"/>
<VersionInfoKeys Name="CFBundleSignature"/>
<VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
<VersionInfoKeys Name="UISupportedInterfaceOrientations"/>
<VersionInfoKeys Name="CFBundleExecutable"/>
<VersionInfoKeys Name="CFBundleResourceSpecification"/>
<VersionInfoKeys Name="LSRequiresIPhoneOS"/>
<VersionInfoKeys Name="CFBundleInfoDictionaryVersion"/>
<VersionInfoKeys Name="CFBundleDevelopmentRegion"/>
</VersionInfoKeys>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>

View File

@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="ZipAnalizer2"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="ZipAnalizer2.dpr"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="uZipAnalizer2.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="dlgZipAnalizer"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="..\..;$(ProjOutDir)"/>
<Libraries Value="..\..\fpc_lib"/>
<OtherUnitFiles Value="..\.."/>
<UnitOutputDirectory Value="."/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 KiB

View File

@@ -0,0 +1,24 @@
rd /S /Q "%cd%\backup\"
rd /S /Q "%cd%\ConverterBackup\"
rd /S /Q "%cd%\lib\"
rd /S /Q "%cd%\__history\"
rd /S /Q "%cd%\__recovery\"
del "%cd%\*.o"
del "%cd%\*.a"
del "%cd%\*.or"
del "%cd%\*.lps"
del "%cd%\*.obj"
del "%cd%\*.exe"
del "%cd%\*.ppu"
del "%cd%\*.dcu"
del "%cd%\*.log"
del "%cd%\*.compiled"
del "%cd%\*.cfg"
del "%cd%\*.dof"
del "%cd%\*.dproj.local"
del "%cd%\*.identcache"
del "%cd%\*.dsk"
del "%cd%\*.skincfg"
del "%cd%\*.bak"
del "%cd%\*.rsm"
del "%cd%\*.~*"

View File

@@ -0,0 +1,102 @@
object dlgZipAnalizer: TdlgZipAnalizer
Left = 301
Top = 184
Caption = #1042#1099#1074#1086#1076' '#1087#1072#1088#1072#1084#1077#1090#1088#1086#1074' ZIP '#1072#1088#1093#1080#1074#1072
ClientHeight = 300
ClientWidth = 685
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
DesignSize = (
685
300)
PixelsPerInch = 96
TextHeight = 13
object edPath: TLabeledEdit
Left = 8
Top = 24
Width = 550
Height = 21
Anchors = [akLeft, akTop, akRight]
EditLabel.Width = 124
EditLabel.Height = 13
EditLabel.Caption = #1059#1082#1072#1078#1080#1090#1077' '#1087#1091#1090#1100' '#1082' '#1072#1088#1093#1080#1074#1091':'
TabOrder = 0
OnChange = edPathChange
end
object btnBrowse: TButton
Left = 560
Top = 22
Width = 25
Height = 25
Anchors = [akTop, akRight]
Caption = '...'
TabOrder = 1
OnClick = btnBrowseClick
end
object btnAnalize: TButton
Left = 591
Top = 22
Width = 75
Height = 25
Anchors = [akTop, akRight]
Caption = #1057#1090#1072#1088#1090
Enabled = False
TabOrder = 2
OnClick = btnAnalizeClick
end
object GroupBox: TGroupBox
Left = 8
Top = 56
Width = 669
Height = 233
Anchors = [akLeft, akTop, akRight, akBottom]
Caption = #1055#1072#1088#1072#1084#1077#1090#1088#1099' '#1072#1088#1093#1080#1074#1072':'
TabOrder = 3
object edReport: TMemo
Left = 2
Top = 15
Width = 665
Height = 216
Align = alClient
Font.Charset = RUSSIAN_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
PopupMenu = PopupMenu
ReadOnly = True
ScrollBars = ssBoth
TabOrder = 0
end
end
object OpenDialog: TOpenDialog
DefaultExt = 'zip'
Filter = 'ZIP '#1072#1088#1093#1080#1074#1099' (*.zip)|*.zip|'#1042#1089#1077' '#1092#1072#1081#1083#1099' (*.*)|*.*'
Options = [ofHideReadOnly, ofFileMustExist, ofEnableSizing]
Left = 48
Top = 88
end
object PopupMenu: TPopupMenu
OnPopup = PopupMenuPopup
Left = 120
Top = 88
object mnuSave: TMenuItem
Caption = #1057#1086#1093#1088#1072#1085#1080#1090#1100'...'
ShortCut = 16467
OnClick = mnuSaveClick
end
end
object SaveDialog: TSaveDialog
DefaultExt = 'txt'
Filter = #1058#1077#1082#1089#1090#1086#1074#1099#1077' '#1092#1072#1081#1083#1099' (*.txt)|*.txt|'#1042#1089#1077' '#1092#1072#1081#1083#1099' (*.*)|*.*'
Left = 208
Top = 88
end
end

View File

@@ -0,0 +1,101 @@
object dlgZipAnalizer: TdlgZipAnalizer
Left = 301
Height = 300
Top = 184
Width = 685
Caption = 'Вывод параметров ZIP архива'
ClientHeight = 300
ClientWidth = 685
Color = clBtnFace
DesignTimePPI = 144
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Position = poScreenCenter
LCLVersion = '2.2.6.0'
object edPath: TLabeledEdit
Left = 8
Height = 21
Top = 24
Width = 550
Anchors = [akTop, akLeft, akRight]
EditLabel.Height = 13
EditLabel.Width = 550
EditLabel.Caption = 'Укажите путь к архиву:'
EditLabel.ParentColor = False
TabOrder = 0
Text = 'E:\2\tst.zip'
OnChange = edPathChange
end
object btnBrowse: TButton
Left = 560
Height = 25
Top = 22
Width = 25
Anchors = [akTop, akRight]
Caption = '...'
OnClick = btnBrowseClick
TabOrder = 1
end
object btnAnalize: TButton
Left = 591
Height = 25
Top = 22
Width = 75
Anchors = [akTop, akRight]
Caption = 'Старт'
Enabled = False
OnClick = btnAnalizeClick
TabOrder = 2
end
object GroupBox: TGroupBox
Left = 8
Height = 233
Top = 56
Width = 669
Anchors = [akTop, akLeft, akRight, akBottom]
Caption = 'Параметры архива:'
ClientHeight = 215
ClientWidth = 665
TabOrder = 3
object edReport: TMemo
Left = 0
Height = 215
Top = 0
Width = 665
Align = alClient
Font.CharSet = RUSSIAN_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
ParentFont = False
PopupMenu = PopupMenu
ReadOnly = True
ScrollBars = ssBoth
TabOrder = 0
end
end
object OpenDialog: TOpenDialog
DefaultExt = '.zip'
Filter = 'ZIP архивы (*.zip)|*.zip|Все файлы (*.*)|*.*'
Options = [ofHideReadOnly, ofFileMustExist, ofEnableSizing]
Left = 48
Top = 88
end
object PopupMenu: TPopupMenu
OnPopup = PopupMenuPopup
Left = 120
Top = 88
object mnuSave: TMenuItem
Caption = 'Сохранить...'
ShortCut = 16467
OnClick = mnuSaveClick
end
end
object SaveDialog: TSaveDialog
DefaultExt = '.txt'
Filter = 'Текстовые файлы (*.txt)|*.txt|Все файлы (*.*)|*.*'
Left = 208
Top = 88
end
end

View File

@@ -0,0 +1,642 @@
////////////////////////////////////////////////////////////////////////////////
//
// ****************************************************************************
// * Project : FWZip - ZipAnalizer2
// * Unit Name : uZipAnalizer2
// * Purpose : Вывод параметров архива при помощи поиска сигнатур
// * Author : Александр (Rouse_) Багель
// * Copyright : © Fangorn Wizards Lab 1998 - 2023.
// * Version : 2.0.0
// * Home Page : http://rouse.drkb.ru
// * Home Blog : http://alexander-bagel.blogspot.ru
// ****************************************************************************
// * Stable Release : http://rouse.drkb.ru/components.php#fwzip
// * Latest Source : https://github.com/AlexanderBagel/FWZip
// ****************************************************************************
//
// Используемые источники:
// ftp://ftp.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
// https://zlib.net/zlib-1.2.13.tar.gz
// http://www.base2ti.com/
//
unit uZipAnalizer2;
{$IFDEF FPC}
{$MODE Delphi}
{$H+}
{$ENDIF}
interface
uses
{$IFDEF FPC}
LCLIntf, LCLType,
{$ENDIF}
SysUtils, Classes, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, ExtCtrls, Menus,
FWZipConsts, FWZipZLib, FWZipUtils;
type
TdlgZipAnalizer = class(TForm)
edPath: TLabeledEdit;
btnBrowse: TButton;
btnAnalize: TButton;
GroupBox: TGroupBox;
edReport: TMemo;
OpenDialog: TOpenDialog;
PopupMenu: TPopupMenu;
mnuSave: TMenuItem;
SaveDialog: TSaveDialog;
procedure btnBrowseClick(Sender: TObject);
procedure edPathChange(Sender: TObject);
procedure btnAnalizeClick(Sender: TObject);
procedure mnuSaveClick(Sender: TObject);
procedure PopupMenuPopup(Sender: TObject);
private
procedure Log(const Value: string);
procedure Scan(const Value: string);
function FindSing(Stream: TStream): DWORD;
procedure ShowLocalFileHeader(Stream: TStream);
procedure ShowDataDescryptor(Stream: TStream);
procedure ShowCentralFileHeader(Stream: TStream);
procedure ShowExtraFields(Stream: TStream; Size: Integer;
FileHeader: TCentralDirectoryFileHeader);
procedure ShowZip64(Stream: TStream);
procedure ShowZip64Locator(Stream: TStream);
procedure ShowEndOfCentralDir(Stream: TStream);
procedure LoadStringValue(Stream: TStream; out Value: string;
nSize: Cardinal; UTF: Boolean);
end;
var
dlgZipAnalizer: TdlgZipAnalizer;
implementation
const
Delim = '===================================================================';
{$R *.dfm}
function CompressionMethodToStr(Value: Integer): string;
begin
case Value of
Z_NO_COMPRESSION: Result := 'NO_COMPRESSION';
Z_DEFLATED: Result := 'DEFLATE';
1: Result := 'Shrunk';
2..5: Result := 'Reduced with compression factor ' + IntToStr(Value - 1);
6: Result := 'Imploding';
9: Result := 'DEFLATE64';
10: Result := 'PKWARE Imploding';
11, 13, 15..17: Result := 'Reserved by PKWARE';
12: Result := 'BZIP2';
14: Result := 'LZMA';
18: Result := 'IBM TERSE';
19: Result := 'IBM LZ77';
97: Result := 'WavPack';
98: Result := 'PPMd';
else
Result := 'unknown';
end;
end;
function GPBFToStr(Value: Word): string;
procedure AddValue(const S: string);
begin
if Result = '' then
Result := S
else
Result := Result + ', ' + S;
end;
begin
if Value = 0 then
begin
Result := 'PBF_COMPRESS_NORMAL';
Exit;
end;
if (Value and 7) in [PBF_COMPRESS_NORMAL, PBF_CRYPTED] then
AddValue('PBF_COMPRESS_NORMAL');
case Value and 6 of
PBF_COMPRESS_MAXIMUM: AddValue('PBF_COMPRESS_MAXIMUM');
PBF_COMPRESS_FAST: AddValue('PBF_COMPRESS_FAST');
PBF_COMPRESS_SUPERFAST: AddValue('PBF_COMPRESS_SUPERFAST');
end;
if PBF_CRYPTED and Value = PBF_CRYPTED then
AddValue('PBF_CRYPTED');
if PBF_DESCRIPTOR and Value = PBF_DESCRIPTOR then
AddValue('PBF_DESCRIPTOR');
if PBF_UTF8 and Value = PBF_UTF8 then
AddValue('PBF_UTF8');
if PBF_STRONG_CRYPT and Value = PBF_STRONG_CRYPT then
AddValue('PBF_STRONG_CRYPT');
end;
procedure TdlgZipAnalizer.btnAnalizeClick(Sender: TObject);
begin
edReport.Lines.BeginUpdate;
try
edReport.Clear;
Log(edPath.Text);
Log(Delim);
Scan(edPath.Text);
Log('DONE');
finally
edReport.Lines.EndUpdate;
end;
end;
procedure TdlgZipAnalizer.btnBrowseClick(Sender: TObject);
begin
UseLongNamePrefix := False;
OpenDialog.InitialDir :=
PathCanonicalize(ExtractFilePath(ParamStr(0)) + '..\DemoResults');
if OpenDialog.Execute then
begin
edPath.Text := OpenDialog.FileName;
edReport.Clear;
end;
end;
procedure TdlgZipAnalizer.edPathChange(Sender: TObject);
begin
btnAnalize.Enabled := FileExists(edPath.Text);
end;
function TdlgZipAnalizer.FindSing(Stream: TStream): DWORD;
const
KnownSigns: array [0..5] of DWORD = (
LOCAL_FILE_HEADER_SIGNATURE,
DATA_DESCRIPTOR_SIGNATURE,
CENTRAL_FILE_HEADER_SIGNATURE,
ZIP64_END_OF_CENTRAL_DIR_SIGNATURE,
ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE,
END_OF_CENTRAL_DIR_SIGNATURE
);
function CalcLen: Integer;
begin
Result := Stream.Size - Stream.Position;
if Result > 1024 then
Result := 1024;
end;
var
pBuff, pCursor: PByte;
I, A, Len: Integer;
OldPosition: Int64;
begin
Result := 0;
GetMem(pBuff, 1024);
try
Len := CalcLen;
while (Result = 0) and (Len > 4) do
begin
OldPosition := Stream.Position;
Stream.ReadBuffer(pBuff^, Len);
pCursor := pBuff;
for I := 0 to Len - 4 do
begin
for A := 0 to 5 do
if PCardinal(pCursor)^ = KnownSigns[A] then
begin
Result := KnownSigns[A];
Break;
end;
if Result = 0 then
Inc(pCursor)
else
begin
Stream.Position := OldPosition + I;
Break;
end;
end;
if Result = 0 then
begin
Len := CalcLen;
if Len > 0 then
Stream.Position := Stream.Position - 4;
end;
end;
finally
FreeMem(pBuff);
end;
end;
procedure TdlgZipAnalizer.LoadStringValue(Stream: TStream;
out Value: string; nSize: Cardinal; UTF: Boolean);
var
aString: AnsiString;
begin
if Integer(nSize) > 0 then
begin
{$IFDEF FPC}
aString := '';
{$ENDIF}
SetLength(aString, nSize);
Stream.ReadBuffer(aString[1], nSize);
if UTF then
begin
{$IFDEF UNICODE}
Value := string(UTF8ToUnicodeString(aString))
{$ELSE}
Value := string(UTF8Decode(aString));
Value := StringReplace(Value, '?', '_', [rfReplaceAll]);
{$ENDIF}
end
else
Value := string(ConvertFromOemString(aString));
end;
end;
procedure TdlgZipAnalizer.Log(const Value: string);
begin
edReport.Lines.Add(Value);
end;
procedure TdlgZipAnalizer.mnuSaveClick(Sender: TObject);
begin
if SaveDialog.Execute then
edReport.Lines.SaveToFile(SaveDialog.FileName);
end;
procedure TdlgZipAnalizer.PopupMenuPopup(Sender: TObject);
begin
mnuSave.Enabled := edReport.Lines.Count > 1;
end;
procedure TdlgZipAnalizer.Scan(const Value: string);
var
F: TFileStream;
Sign: DWORD;
begin
F := TFileStream.Create(Value, fmOpenRead or fmShareDenyWrite);
try
Sign := FindSing(F);
while Sign <> 0 do
begin
case Sign of
LOCAL_FILE_HEADER_SIGNATURE: ShowLocalFileHeader(F);
DATA_DESCRIPTOR_SIGNATURE: ShowDataDescryptor(F);
CENTRAL_FILE_HEADER_SIGNATURE: ShowCentralFileHeader(F);
ZIP64_END_OF_CENTRAL_DIR_SIGNATURE: ShowZip64(F);
ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE: ShowZip64Locator(F);
END_OF_CENTRAL_DIR_SIGNATURE: ShowEndOfCentralDir(F);
end;
Sign := FindSing(F);
end;
finally
F.Free;
end;
end;
procedure TdlgZipAnalizer.ShowCentralFileHeader(Stream: TStream);
var
Data: TCentralDirectoryFileHeader;
FileName, Comment: string;
begin
Log('CENTRAL_FILE_HEADER_SIGNATURE found at offset: ' + IntToStr(Stream.Position));
{$IFDEF FPC}
Data := Default(TCentralDirectoryFileHeader);
{$ENDIF}
Stream.ReadBuffer(Data, SizeOf(TCentralDirectoryFileHeader));
with Data do
begin
if CentralFileHeaderSignature <> CENTRAL_FILE_HEADER_SIGNATURE then
Log('INVALID SIGNATURE!!!!');
Log(Format('VersionMadeBy: %d', [VersionMadeBy]));
Log(Format('VersionNeededToExtract: %d', [VersionNeededToExtract]));
Log(Format('GeneralPurposeBitFlag: %d (%s)', [GeneralPurposeBitFlag,
GPBFToStr(GeneralPurposeBitFlag)]));
Log(Format('CompressionMethod: %d (%s)', [CompressionMethod, CompressionMethodToStr(CompressionMethod)]));
Log(Format('LastModFileTimeTime: %d', [LastModFileTimeTime]));
Log(Format('LastModFileTimeDate: %d', [LastModFileTimeDate]));
Log(Format('Crc32: %d', [Crc32]));
Log(Format('CompressedSize: %d', [CompressedSize]));
Log(Format('UncompressedSize: %d', [UncompressedSize]));
Log(Format('FilenameLength: %d', [FilenameLength]));
Log(Format('ExtraFieldLength: %d', [ExtraFieldLength]));
Log(Format('FileCommentLength: %d', [FileCommentLength]));
Log(Format('DiskNumberStart: %d', [DiskNumberStart]));
Log(Format('InternalFileAttributes: %d', [InternalFileAttributes]));
Log(Format('ExternalFileAttributes: %d', [ExternalFileAttributes]));
Log(Format('RelativeOffsetOfLocalHeader: %d', [RelativeOffsetOfLocalHeader]));
LoadStringValue(Stream, FileName, FilenameLength,
GeneralPurposeBitFlag and PBF_UTF8 <> 0);
Log('>>> FileName: ' + FileName);
Log(Delim);
ShowExtraFields(Stream, ExtraFieldLength, Data);
if FileCommentLength > 0 then
begin
LoadStringValue(Stream, Comment, FileCommentLength,
GeneralPurposeBitFlag and PBF_UTF8 <> 0);
Log('>>> FileComment: ' + Comment);
Log(Delim);
end;
end;
end;
procedure TdlgZipAnalizer.ShowDataDescryptor(Stream: TStream);
var
Data: TDataDescriptor;
StartPos: Int64;
begin
StartPos := Stream.Position;
{$IFDEF FPC}
Data := Default(TDataDescriptor);
{$ENDIF}
Stream.ReadBuffer(Data, SizeOf(TDataDescriptor));
if Data.Crc32 = LOCAL_FILE_HEADER_SIGNATURE then
begin
Log('SPAN_DESCRIPTOR_SIGNATURE found at offset: ' + IntToStr(StartPos));
Log(Delim);
Stream.Position := StartPos + SizeOf(DWORD);
Exit;
end;
Log('DATA_DESCRIPTOR_SIGNATURE found at offset: ' + IntToStr(StartPos));
with Data do
begin
if DescriptorSignature <> DATA_DESCRIPTOR_SIGNATURE then
Log('INVALID SIGNATURE!!!!');
Log(Format('Crc32: %d', [Crc32]));
Log(Format('CompressedSize: %d', [CompressedSize]));
Log(Format('UncompressedSize: %d', [UncompressedSize]));
end;
Log(Delim);
end;
procedure TdlgZipAnalizer.ShowEndOfCentralDir(Stream: TStream);
var
Data: TEndOfCentralDir;
Comment: string;
begin
Log('END_OF_CENTRAL_DIR_SIGNATURE found at offset: ' + IntToStr(Stream.Position));
{$IFDEF FPC}
Data := Default(TEndOfCentralDir);
{$ENDIF}
Stream.ReadBuffer(Data, SizeOf(TEndOfCentralDir));
with Data do
begin
if EndOfCentralDirSignature <> END_OF_CENTRAL_DIR_SIGNATURE then
Log('INVALID SIGNATURE!!!!');
Log(Format('NumberOfThisDisk: %d', [NumberOfThisDisk]));
Log(Format('DiskNumberStart: %d', [DiskNumberStart]));
Log(Format('TotalNumberOfEntriesOnThisDisk: %d', [TotalNumberOfEntriesOnThisDisk]));
Log(Format('TotalNumberOfEntries: %d', [TotalNumberOfEntries]));
Log(Format('SizeOfTheCentralDirectory: %d', [SizeOfTheCentralDirectory]));
Log(Format('RelativeOffsetOfCentralDirectory: %d', [RelativeOffsetOfCentralDirectory]));
Log(Format('ZipfileCommentLength: %d', [ZipfileCommentLength]));
if ZipfileCommentLength > 0 then
begin
LoadStringValue(Stream, Comment, ZipfileCommentLength, False);
Log(Format('>>> Comment: %s', [Comment]));
end;
end;
Log(Delim);
end;
procedure TdlgZipAnalizer.ShowExtraFields(Stream: TStream; Size: Integer;
FileHeader: TCentralDirectoryFileHeader);
var
Buff, EOFBuff: Pointer;
BuffCount: Integer;
HeaderID, BlockSize: Word;
function GetOffset(Value: Integer): Pointer;
begin
Result := UIntToPtr(PtrToUInt(EOFBuff) - NativeUInt(Value));
end;
function ByteToStr(Bytes: PByte; Size: Integer): string;
const
BytesHex: array[0..15] of char =
('0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F');
var
I: Integer;
begin
{$IFDEF FPC}
Result := '';
{$ENDIF}
SetLength(Result, Size shl 1);
for I := 0 to Size - 1 do
begin
Result[I * 2 + 1] := BytesHex[Bytes^ shr 4];
Result[I * 2 + 2] := BytesHex[Bytes^ and $0F];
Inc(Bytes);
end;
end;
var
ExDataStream: TMemoryStream;
StartPos: Int64;
FileTime: TFileTime;
begin
if Size = 0 then Exit;
StartPos := Stream.Position;
Log('EXDATA found at offset: ' + IntToStr(StartPos));
Log(Delim);
GetMem(Buff, Size);
try
BuffCount := Size;
Stream.ReadBuffer(Buff^, BuffCount);
EOFBuff := UIntToPtr(PtrToUInt(Buff) + NativeUInt(BuffCount));
while BuffCount > 0 do
begin
HeaderID := PWord(GetOffset(BuffCount))^;
Dec(BuffCount, 2);
BlockSize := PWord(GetOffset(BuffCount))^;
Dec(BuffCount, 2);
case HeaderID of
SUPPORTED_EXDATA_ZIP64:
begin
Log('SUPPORTED_EXDATA_ZIP64 found at offset: ' +
IntToStr(StartPos + Size - BuffCount - 4));
if FileHeader.UncompressedSize = MAXDWORD then
begin
if BuffCount < 8 then Break;
Log('UncompressedSize: ' + IntToStr(PInt64(GetOffset(BuffCount))^));
Dec(BuffCount, 8);
Dec(BlockSize, 8);
end;
if FileHeader.CompressedSize = MAXDWORD then
begin
if BuffCount < 8 then Break;
Log('CompressedSize: ' + IntToStr(PInt64(GetOffset(BuffCount))^));
Dec(BuffCount, 8);
Dec(BlockSize, 8);
end;
if FileHeader.RelativeOffsetOfLocalHeader = MAXDWORD then
begin
if BuffCount < 8 then Break;
Log('RelativeOffsetOfLocalHeader: ' + IntToStr(PInt64(GetOffset(BuffCount))^));
Dec(BuffCount, 8);
Dec(BlockSize, 8);
end;
if FileHeader.DiskNumberStart = MAXWORD then
begin
if BuffCount < 4 then Break;
Log('DiskNumberStart: ' + IntToStr(PInt64(GetOffset(BuffCount))^));
Dec(BuffCount, 4);
Dec(BlockSize, 4);
end;
Dec(BuffCount, BlockSize);
Log(Delim);
end;
SUPPORTED_EXDATA_NTFSTIME:
begin
if BuffCount < 32 then Break;
if BlockSize <> 32 then
begin
Dec(BuffCount, BlockSize);
Continue;
end;
Dec(BuffCount, 4);
Dec(BlockSize, 4);
if PWord(GetOffset(BuffCount))^ <> 1 then
begin
Dec(BuffCount, BlockSize);
Continue;
end;
Dec(BuffCount, 2);
Dec(BlockSize, 2);
if PWord(GetOffset(BuffCount))^ <> SizeOf(TNTFSFileTime) then
begin
Dec(BuffCount, BlockSize);
Continue;
end;
Dec(BuffCount, 2);
Dec(BlockSize, 2);
Log('SUPPORTED_EXDATA_NTFSTIME found at offset: ' +
IntToStr(StartPos + Size - BuffCount - 12));
FileTime := PFileTime(GetOffset(BuffCount))^;
Dec(BuffCount, SizeOf(TFileTime));
Dec(BlockSize, SizeOf(TFileTime));
Log(Format('Last Write Time: %s', [DateTimeToStr(FileTimeToLocalDateTime(FileTime))]));
FileTime := PFileTime(GetOffset(BuffCount))^;
Dec(BuffCount, SizeOf(TFileTime));
Dec(BlockSize, SizeOf(TFileTime));
Log(Format('Last Access Time: %s', [DateTimeToStr(FileTimeToLocalDateTime(FileTime))]));
FileTime := PFileTime(GetOffset(BuffCount))^;
Dec(BuffCount, SizeOf(TFileTime));
Dec(BlockSize, SizeOf(TFileTime));
Log(Format('Creation Time: %s', [DateTimeToStr(FileTimeToLocalDateTime(FileTime))]));
Log(Delim);
end;
else
Log(Format('UNKNOWN EXDATA TAG %d found at offset: %d',
[HeaderID, StartPos + Size - BuffCount - 8]));
ExDataStream := TMemoryStream.Create;
try
ExDataStream.WriteBuffer(GetOffset(BuffCount)^, BlockSize);
ExDataStream.Position := 0;
Log(ByteToStr(ExDataStream.Memory, ExDataStream.Size));
finally
ExDataStream.Free;
end;
Log(Delim);
end;
Dec(BuffCount, BlockSize);
end;
finally
FreeMem(Buff);
end;
end;
procedure TdlgZipAnalizer.ShowLocalFileHeader(Stream: TStream);
var
Data: TLocalFileHeader;
FileName: string;
begin
Log('LOCAL_FILE_HEADER_SIGNATURE found at offset: ' + IntToStr(Stream.Position));
{$IFDEF FPC}
Data := Default(TLocalFileHeader);
{$ENDIF}
Stream.ReadBuffer(Data, SizeOf(TLocalFileHeader));
with Data do
begin
if LocalFileHeaderSignature <> LOCAL_FILE_HEADER_SIGNATURE then
Log('INVALID SIGNATURE!!!!');
Log(Format('VersionNeededToExtract: %d', [VersionNeededToExtract]));
Log(Format('GeneralPurposeBitFlag: %d (%s)', [GeneralPurposeBitFlag,
GPBFToStr(GeneralPurposeBitFlag)]));
Log(Format('CompressionMethod: %d (%s)', [CompressionMethod, CompressionMethodToStr(CompressionMethod)]));
Log(Format('LastModFileTimeTime: %d', [LastModFileTimeTime]));
Log(Format('LastModFileTimeDate: %d', [LastModFileTimeDate]));
Log(Format('Crc32: %d', [Crc32]));
Log(Format('CompressedSize: %d', [CompressedSize]));
Log(Format('UncompressedSize: %d', [UncompressedSize]));
Log(Format('FilenameLength: %d', [FilenameLength]));
Log(Format('ExtraFieldLength: %d', [ExtraFieldLength]));
LoadStringValue(Stream, FileName, FilenameLength,
GeneralPurposeBitFlag and PBF_UTF8 <> 0);
Log('>>> FileName: ' + FileName);
end;
Log(Delim);
end;
procedure TdlgZipAnalizer.ShowZip64(Stream: TStream);
var
Data: TZip64EOFCentralDirectoryRecord;
begin
Log('ZIP64_END_OF_CENTRAL_DIR_SIGNATURE found at offset: ' + IntToStr(Stream.Position));
{$IFDEF FPC}
Data := Default(TZip64EOFCentralDirectoryRecord);
{$ENDIF}
Stream.ReadBuffer(Data, SizeOf(TZip64EOFCentralDirectoryRecord));
with Data do
begin
if Zip64EndOfCentralDirSignature <> ZIP64_END_OF_CENTRAL_DIR_SIGNATURE then
Log('INVALID SIGNATURE!!!!');
Log(Format('SizeOfZip64EOFCentralDirectoryRecord: %d', [SizeOfZip64EOFCentralDirectoryRecord]));
Log(Format('VersionMadeBy: %d', [VersionMadeBy]));
Log(Format('VersionNeededToExtract: %d', [VersionNeededToExtract]));
Log(Format('number of this disk: %d', [NumberOfThisDisk]));
Log(Format('number of the disk with the start of the central directory: %d', [DiskNumberStart]));
Log(Format('total number of entries in the central directory on this disk: %d', [TotalNumberOfEntriesOnThisDisk]));
Log(Format('total number of entries in the central directory: %d', [TotalNumberOfEntries]));
Log(Format('size of the central directory: %d', [SizeOfTheCentralDirectory]));
Log(Format('offset of start of central directory with respect to the starting disk number: %d', [RelativeOffsetOfCentralDirectory]));
end;
Log(Delim);
end;
procedure TdlgZipAnalizer.ShowZip64Locator(Stream: TStream);
var
Data: TZip64EOFCentralDirectoryLocator;
begin
Log('ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE found at offset: ' + IntToStr(Stream.Position));
{$IFDEF FPC}
Data := Default(TZip64EOFCentralDirectoryLocator);
{$ENDIF}
Stream.ReadBuffer(Data, SizeOf(TZip64EOFCentralDirectoryLocator));
with Data do
begin
if Signature <> ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE then
Log('INVALID SIGNATURE!!!!');
Log(Format('NumberOfTheDisk: %d', [DiskNumberStart]));
Log(Format('RelativeOffset: %d', [RelativeOffset]));
Log(Format('TotalNumberOfDisks: %d', [TotalNumberOfDisks]));
end;
Log(Delim);
end;
end.