|
@@ -926,7 +926,7 @@ Begin
|
|
finally
|
|
finally
|
|
FindClose(Info);
|
|
FindClose(Info);
|
|
end;
|
|
end;
|
|
- end;
|
|
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
|
|
|
|
Procedure TZipper.OpenOutput;
|
|
Procedure TZipper.OpenOutput;
|
|
@@ -1132,13 +1132,13 @@ Begin
|
|
For I:=0 to FFiles.Count-1 do
|
|
For I:=0 to FFiles.Count-1 do
|
|
begin
|
|
begin
|
|
Item:=FFiles.Objects[i] as TZipItem;
|
|
Item:=FFiles.Objects[i] as TZipItem;
|
|
- if assigned(Item) then
|
|
|
|
- begin
|
|
|
|
|
|
+ if assigned(Item) then
|
|
|
|
+ begin
|
|
ZipOneFile(Item);
|
|
ZipOneFile(Item);
|
|
- inc(filecnt);
|
|
|
|
- end;
|
|
|
|
|
|
+ inc(filecnt);
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
- if filecnt>0 then
|
|
|
|
|
|
+ if filecnt>0 then
|
|
BuildZipDirectory;
|
|
BuildZipDirectory;
|
|
finally
|
|
finally
|
|
CloseOutput;
|
|
CloseOutput;
|
|
@@ -1232,6 +1232,7 @@ End;
|
|
Function TUnZipper.OpenOutput(OutFileName : String) : Boolean;
|
|
Function TUnZipper.OpenOutput(OutFileName : String) : Boolean;
|
|
|
|
|
|
Begin
|
|
Begin
|
|
|
|
+ ForceDirectories(ExtractFilePath(OutFileName));
|
|
FOutFile:=TFileStream.Create(OutFileName,fmCreate);
|
|
FOutFile:=TFileStream.Create(OutFileName,fmCreate);
|
|
Result:=True;
|
|
Result:=True;
|
|
If Assigned(FOnStartFile) then
|
|
If Assigned(FOnStartFile) then
|
|
@@ -1331,7 +1332,7 @@ Begin
|
|
OutputFileName:=Item.Name;
|
|
OutputFileName:=Item.Name;
|
|
if FOutputPath<>'' then
|
|
if FOutputPath<>'' then
|
|
OutputFileName:=IncludeTrailingPathDelimiter(FOutputPath)+OutputFileName;
|
|
OutputFileName:=IncludeTrailingPathDelimiter(FOutputPath)+OutputFileName;
|
|
- OpenOutput(OutputFileName);
|
|
|
|
|
|
+ OpenOutput(OutputFileName);
|
|
if ZMethod=0 then
|
|
if ZMethod=0 then
|
|
begin
|
|
begin
|
|
Count:=FOutFile.CopyFrom(FZipFile,LocalHdr.Compressed_Size);
|
|
Count:=FOutFile.CopyFrom(FZipFile,LocalHdr.Compressed_Size);
|
|
@@ -1358,18 +1359,19 @@ Procedure TUnZipper.UnZipAllFiles;
|
|
Var
|
|
Var
|
|
Item : TZipItem;
|
|
Item : TZipItem;
|
|
I : Integer;
|
|
I : Integer;
|
|
-
|
|
|
|
|
|
+ AllFiles : Boolean;
|
|
Begin
|
|
Begin
|
|
FUnZipping:=True;
|
|
FUnZipping:=True;
|
|
Try
|
|
Try
|
|
|
|
+ AllFiles:=(FFiles.Count=0);
|
|
OpenInput;
|
|
OpenInput;
|
|
Try
|
|
Try
|
|
ReadZipDirectory;
|
|
ReadZipDirectory;
|
|
For I:=0 to FZipEntries.Count-1 do
|
|
For I:=0 to FZipEntries.Count-1 do
|
|
begin
|
|
begin
|
|
Item:=TZipItem(FZipEntries[i]);
|
|
Item:=TZipItem(FZipEntries[i]);
|
|
- if (FFiles=nil) or
|
|
|
|
- (FFiles.IndexOf(Item.Name)<>-1) then
|
|
|
|
|
|
+ if AllFiles or
|
|
|
|
+ (FFiles.IndexOf(Item.Name)<>-1) then
|
|
UnZipOneFile(Item);
|
|
UnZipOneFile(Item);
|
|
end;
|
|
end;
|
|
Finally
|
|
Finally
|