瀏覽代碼

Fix RegisterResourcesWithRestartManager breaking Setup entirely on EnumFiles exception. Fixed by delaing it the same way as it already did with [Code] throwing exception.

Martijn Laan 3 月之前
父節點
當前提交
16a7b607e3
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      Projects/Src/Setup.MainFunc.pas

+ 6 - 1
Projects/Src/Setup.MainFunc.pas

@@ -2026,7 +2026,12 @@ begin
   try
     { Register our files. }
     RmRegisteredFilesCount := 0;
-    EnumFiles(RegisterFile, WizardComponents, WizardTasks, Pointer(True));
+    try
+      EnumFiles(RegisterFile, WizardComponents, WizardTasks, Pointer(True));
+    except
+      Log('EnumFiles(RegisterFiles) raised an exception.');
+      Application.HandleException(nil);
+    end;
     { Ask [Code] for more files. }
     if CodeRunner <> nil then begin
       AllowCodeRegisterExtraCloseApplicationsResource := True;