2
0
Эх сурвалжийг харах

Clarify logging when there's nothing to extract from an archive. (Likely cause: all files are in a subdir but recursesubdirs wasnt used.)

Martijn Laan 2 сар өмнө
parent
commit
05e77967bb

+ 9 - 9
Projects/Src/Compression.SevenZipDLLDecoder.pas

@@ -1175,6 +1175,15 @@ begin
   State.Password := Password;
   State.RecurseSubDirs := RecurseSubDirs;
 
+  { Log start of extraction }
+  if ExtractIntent then begin
+    LogFmt('Start extracting archive %s to %s. Recurse subdirs? %s', [ArchiveFilename,
+      RemoveBackslashUnlessRoot(DestDir), SYesNo[RecurseSubDirs]]);
+    var Solid: Boolean;
+    if GetProperty(State.InArchive, $FFFF, kpidSolid, Solid) and Solid then
+      Log('Archive is solid; extraction performance may degrade');
+  end;
+
   if State.numItems > 0 then begin
     for var currentIndex: UInt32 := 0 to State.numItems-1 do begin
       if State.GetInitialCurrentFindData(FindFileData) then begin
@@ -1186,15 +1195,6 @@ begin
           ArchiveFindStates := TArchiveFindStates.Create;
         ArchiveFindStates.Add(State);
 
-        { Log start of extraction }
-        if ExtractIntent then begin
-          LogFmt('Start extracting archive %s to %s. Recurse subdirs? %s', [ArchiveFilename,
-            RemoveBackslashUnlessRoot(DestDir), SYesNo[RecurseSubDirs]]);
-          var Solid: Boolean;
-          if GetProperty(State.InArchive, $FFFF, kpidSolid, Solid) and Solid then
-            Log('Archive is solid; extraction performance may degrade');
-        end;
-
         { Finish find data & exit }
         State.FinishCurrentFindData(FindFileData);
         Exit(ArchiveFindStates.Count-1);

+ 2 - 1
Projects/Src/Setup.Install.pas

@@ -2111,7 +2111,8 @@ var
           end;
 
           Log('Successfully extracted the archive.');
-        end;
+        end else
+          Log('Found no files to extract.');
       finally
         VerifySourceF.Free;
       end;