Bläddra i källkod

EnumFiles: ignore external file exceptions just like minimum disk space calculation by InitializeSetup does. Affects PreviousInstallNotCompleted check and RegisterResourcesWithRestartManager. So those will now also skip problematic external files, which is fine. Doing on branch but would be good even on main I believe even though there it's harder to get an exception.

Martijn Laan 3 månader sedan
förälder
incheckning
8d8b54b8b2
1 ändrade filer med 17 tillägg och 12 borttagningar
  1. 17 12
      Projects/Src/Setup.MainFunc.pas

+ 17 - 12
Projects/Src/Setup.MainFunc.pas

@@ -1862,17 +1862,22 @@ begin
           end;
         end
         else begin
-          { External file }
-          SourceWildcard := ExpandConst(CurFile^.SourceFilename);
-          Excludes.DelimitedText := CurFile^.Excludes;
-          if foExtractArchive in CurFile^.Options then begin
-            if not RecurseExternalArchiveFiles(DisableFsRedir, SourceWildcard,
-               CurFile^.ExtractArchivePassword, Excludes, CurFile) then
-              Exit(False);
-          end else begin
-            if not RecurseExternalFiles(DisableFsRedir, PathExtractPath(SourceWildcard), '',
-               PathExtractName(SourceWildcard), IsWildcard(SourceWildcard), Excludes, CurFile) then
-              Exit(False);
+          try
+            { External file }
+            SourceWildcard := ExpandConst(CurFile^.SourceFilename);
+            Excludes.DelimitedText := CurFile^.Excludes;
+            if foExtractArchive in CurFile^.Options then begin
+              if not RecurseExternalArchiveFiles(DisableFsRedir, SourceWildcard,
+                 CurFile^.ExtractArchivePassword, Excludes, CurFile) then
+                Exit(False);
+            end else begin
+              if not RecurseExternalFiles(DisableFsRedir, PathExtractPath(SourceWildcard), '',
+                 PathExtractName(SourceWildcard), IsWildcard(SourceWildcard), Excludes, CurFile) then
+                Exit(False);
+            end;
+          except
+            { Ignore expections, just like minimum disk space calculation by
+              InitializeSetup does }
           end;
         end;
       end;
@@ -3529,7 +3534,7 @@ begin
 	            end;
 	          except
 	            { Ignore exceptions. One notable exception we want to ignore is
-	              the one about "app" not being initialized. }
+	              the one about "app" not being initialized. Also see EnumFiles. }
 	          end;
 	        end;
 	        if Components = '' then { no types or a file that doesn't belong to any component }