Browse Source

Merge branch 'main' into issigkeys

# Conflicts:
#	Projects/Src/Compiler.SetupCompiler.pas
Martijn Laan 4 tháng trước cách đây
mục cha
commit
df8eab67a8

+ 1 - 1
ISHelp/ISHelpGen/ISHelpGen.dpr

@@ -716,7 +716,7 @@ var
           elContentsHeading:
             begin
               Inc(CurHeadingID);
-              SL.Add(Format('<tr id="nodecaption_%d"><td><img id="nodeimg_%d" src="images/contentsheadopen.png" alt="&gt;&nbsp;" onclick="toggle_node(%d);" /></td>' +
+              SL.Add(Format('<tr id="nodecaption_%d"><td><img id="nodeimg_%d" src="images/contentsheadopen.svg" alt="&gt;&nbsp;" onclick="toggle_node(%d);" /></td>' +
                 '<td><a href="javascript:toggle_node(%d);">%s</a></td></tr>',
                 [CurHeadingID, CurHeadingID, CurHeadingID, CurHeadingID, EscapeHTML(Node.Attributes['title'])]));
               SL.Add(Format('<tr id="nodecontent_%d"><td></td><td>', [CurHeadingID]));

+ 34 - 34
Projects/Src/Compiler.SetupCompiler.pas

@@ -312,19 +312,11 @@ type
     Name, Command: String;
   end;
 
-const
-  ISSigKeyEntryExtraInfoStrings = 1;
-  ISSigKeyEntryExtraInfoAnsiStrings = 0;
-type
   PISSigKeyEntryExtraInfo = ^TISSigKeyEntryExtraInfo;
   TISSigKeyEntryExtraInfo = record
     Name: String;
   end;
 
-const
-  FileLocationEntryExtraInfoStrings = 1;
-  FileLocationEntryExtraInfoAnsiStrings = 0;
-type
   TFileLocationSign = (fsNoSetting, fsYes, fsOnce, fsCheck);
   PFileLocationEntryExtraInfo = ^TFileLocationEntryExtraInfo;
   TFileLocationEntryExtraInfo = record
@@ -4512,7 +4504,8 @@ begin
   NewISSigKeyEntry := nil;
   NewISSigKeyEntryExtraInfo := nil;
   try
-    NewISSigKeyEntryExtraInfo := AllocMem(SizeOf(TISSigKeyEntryExtraInfo));
+    New(NewISSigKeyEntryExtraInfo);
+    FillChar(NewISSigKeyEntryExtraInfo^, SizeOf(TISSigKeyEntryExtraInfo), 0);
     with NewISSigKeyEntryExtraInfo^ do begin
       { Name }
       if not IsValidIdentString(Values[paName].Data, False, False) then
@@ -4575,7 +4568,7 @@ begin
     end;
   except
     SEFreeRec(NewISSigKeyEntry, SetupISSigKeyEntryStrings, SetupISSigKeyEntryAnsiStrings);
-    SEFreeRec(NewISSigKeyEntryExtraInfo, ISSigKeyEntryExtraInfoStrings, ISSigKeyEntryExtraInfoAnsiStrings);
+    Dispose(NewISSigKeyEntryExtraInfo);
     raise;
   end;
   ISSigKeyEntries.Add(NewISSigKeyEntry);
@@ -4961,7 +4954,8 @@ type
         end;
         if NewFileLocationEntry = nil then begin
           NewFileLocationEntry := AllocMem(SizeOf(TSetupFileLocationEntry));
-          NewFileLocationEntryExtraInfo := AllocMem(SizeOf(TFileLocationEntryExtraInfo));
+          New(NewFileLocationEntryExtraInfo);
+          FillChar(NewFileLocationEntryExtraInfo^, SizeOf(TFileLocationEntryExtraInfo), 0);
           SetupHeader.CompressMethod := CompressMethod;
           FileLocationEntries.Add(NewFileLocationEntry);
           FileLocationEntryExtraInfos.Add(NewFileLocationEntryExtraInfo);
@@ -6651,16 +6645,22 @@ procedure TSetupCompiler.Compile;
     end;
   end;
 
-  procedure FreeListItems(const List: TList; const NumStrings, NumAnsiStrings: Integer);
-  var
-    I: Integer;
+  procedure FreeSEListItems(const List: TList; const NumStrings, NumAnsiStrings: Integer);
   begin
-    for I := List.Count-1 downto 0 do begin
+    for var I := List.Count-1 downto 0 do begin
       SEFreeRec(List[I], NumStrings, NumAnsiStrings);
       List.Delete(I);
     end;
   end;
 
+  procedure FreeListItems(const List: TList);
+  begin
+    for var I := List.Count-1 downto 0 do begin
+      Dispose(List[I]);
+      List.Delete(I);
+    end;
+  end;
+
   procedure FreePreLangData;
   var
     I: Integer;
@@ -8218,27 +8218,27 @@ begin
     SetupE32.Free;
     WizardSmallImages.Free;
     WizardImages.Free;
-    FreeListItems(LanguageEntries, SetupLanguageEntryStrings, SetupLanguageEntryAnsiStrings);
-    FreeListItems(CustomMessageEntries, SetupCustomMessageEntryStrings, SetupCustomMessageEntryAnsiStrings);
-    FreeListItems(PermissionEntries, SetupPermissionEntryStrings, SetupPermissionEntryAnsiStrings);
-    FreeListItems(TypeEntries, SetupTypeEntryStrings, SetupTypeEntryAnsiStrings);
-    FreeListItems(ComponentEntries, SetupComponentEntryStrings, SetupComponentEntryAnsiStrings);
-    FreeListItems(TaskEntries, SetupTaskEntryStrings, SetupTaskEntryAnsiStrings);
-    FreeListItems(DirEntries, SetupDirEntryStrings, SetupDirEntryAnsiStrings);
-    FreeListItems(FileEntries, SetupFileEntryStrings, SetupFileEntryAnsiStrings);
-    FreeListItems(FileLocationEntries, SetupFileLocationEntryStrings, SetupFileLocationEntryAnsiStrings);
-    FreeListItems(ISSigKeyEntries, SetupISSigKeyEntryStrings, SetupISSigKeyEntryAnsiStrings);
-    FreeListItems(IconEntries, SetupIconEntryStrings, SetupIconEntryAnsiStrings);
-    FreeListItems(IniEntries, SetupIniEntryStrings, SetupIniEntryAnsiStrings);
-    FreeListItems(RegistryEntries, SetupRegistryEntryStrings, SetupRegistryEntryAnsiStrings);
-    FreeListItems(InstallDeleteEntries, SetupDeleteEntryStrings, SetupDeleteEntryAnsiStrings);
-    FreeListItems(UninstallDeleteEntries, SetupDeleteEntryStrings, SetupDeleteEntryAnsiStrings);
-    FreeListItems(RunEntries, SetupRunEntryStrings, SetupRunEntryAnsiStrings);
-    FreeListItems(UninstallRunEntries, SetupRunEntryStrings, SetupRunEntryAnsiStrings);
+    FreeSEListItems(LanguageEntries, SetupLanguageEntryStrings, SetupLanguageEntryAnsiStrings);
+    FreeSEListItems(CustomMessageEntries, SetupCustomMessageEntryStrings, SetupCustomMessageEntryAnsiStrings);
+    FreeSEListItems(PermissionEntries, SetupPermissionEntryStrings, SetupPermissionEntryAnsiStrings);
+    FreeSEListItems(TypeEntries, SetupTypeEntryStrings, SetupTypeEntryAnsiStrings);
+    FreeSEListItems(ComponentEntries, SetupComponentEntryStrings, SetupComponentEntryAnsiStrings);
+    FreeSEListItems(TaskEntries, SetupTaskEntryStrings, SetupTaskEntryAnsiStrings);
+    FreeSEListItems(DirEntries, SetupDirEntryStrings, SetupDirEntryAnsiStrings);
+    FreeSEListItems(FileEntries, SetupFileEntryStrings, SetupFileEntryAnsiStrings);
+    FreeSEListItems(FileLocationEntries, SetupFileLocationEntryStrings, SetupFileLocationEntryAnsiStrings);
+    FreeSEListItems(ISSigKeyEntries, SetupISSigKeyEntryStrings, SetupISSigKeyEntryAnsiStrings);
+    FreeSEListItems(IconEntries, SetupIconEntryStrings, SetupIconEntryAnsiStrings);
+    FreeSEListItems(IniEntries, SetupIniEntryStrings, SetupIniEntryAnsiStrings);
+    FreeSEListItems(RegistryEntries, SetupRegistryEntryStrings, SetupRegistryEntryAnsiStrings);
+    FreeSEListItems(InstallDeleteEntries, SetupDeleteEntryStrings, SetupDeleteEntryAnsiStrings);
+    FreeSEListItems(UninstallDeleteEntries, SetupDeleteEntryStrings, SetupDeleteEntryAnsiStrings);
+    FreeSEListItems(RunEntries, SetupRunEntryStrings, SetupRunEntryAnsiStrings);
+    FreeSEListItems(UninstallRunEntries, SetupRunEntryStrings, SetupRunEntryAnsiStrings);
     FileLocationEntryFilenames.Clear;
-    FreeListItems(FileLocationEntryExtraInfos, FileLocationEntryExtraInfoStrings, FileLocationEntryExtraInfoAnsiStrings);
+    FreeListItems(FileLocationEntryExtraInfos);
     ISSigKeyEntryNames.Clear;
-    FreeListItems(ISSigKeyEntryExtraInfos, ISSigKeyEntryExtraInfoStrings, ISSigKeyEntryExtraInfoAnsiStrings);
+    FreeListItems(ISSigKeyEntryExtraInfos);
     FreeLineInfoList(ExpectedCustomMessageNames);
     FreeLangData;
     FreePreLangData;

+ 21 - 3
Projects/Src/Compression.LZMACompressor.pas

@@ -2,7 +2,7 @@ unit Compression.LZMACompressor;
 
 {
   Inno Setup
-  Copyright (C) 1997-2024 Jordan Russell
+  Copyright (C) 1997-2025 Jordan Russell
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
 
@@ -155,6 +155,7 @@ type
     FThread: THandle;
     FLZMAHandle: TLZMACompressorHandle;
     FReadLock, FWriteLock, FProgressLock: Integer;
+    FSavedFatalException: TObject;
     function CheckTerminateWorkerEvent: HRESULT;
     function FillBuffer(const AWrite: Boolean; const Data: Pointer;
       Size: Cardinal; var ProcessedSize: Cardinal): HRESULT;
@@ -433,10 +434,17 @@ end;
 
 function WorkerThreadFunc(Parameter: Pointer): Integer;
 begin
+  const T = TLZMAWorkerThread(Parameter);
   try
-    TLZMAWorkerThread(Parameter).WorkerThreadProc;
+    T.WorkerThreadProc;
   except
+    const Ex = AcquireExceptionObject;
+    MemoryBarrier;
+    T.FSavedFatalException := Ex;
   end;
+  { Be extra sure FSavedFatalException (and everything else) is made visible
+    prior to thread termination. (Likely redundant, but you never know...) }
+  MemoryBarrier;
   Result := 0;
 end;
 
@@ -460,6 +468,7 @@ begin
     LZMA_End(FLZMAHandle);
   if Assigned(FShared) then
     VirtualFree(FShared, 0, MEM_RELEASE);
+  FreeAndNil(FSavedFatalException);
   inherited;
 end;
 
@@ -490,7 +499,16 @@ end;
 
 procedure TLZMAWorkerThread.UnexpectedTerminationError;
 begin
-  LZMAInternalError('Worker thread terminated unexpectedly');
+  if Assigned(FSavedFatalException) then begin
+    var Msg: String;
+    if FSavedFatalException is Exception then
+      Msg := (FSavedFatalException as Exception).Message
+    else
+      Msg := FSavedFatalException.ClassName;
+    LZMAInternalErrorFmt('Worker thread terminated unexpectedly with exception: %s',
+      [Msg]);
+  end else
+    LZMAInternalError('Worker thread terminated unexpectedly; no exception');
 end;
 
 procedure TLZMAWorkerThread.WorkerThreadProc;

+ 1 - 1
whatsnew.htm

@@ -42,7 +42,7 @@ For conditions of distribution and use, see <a href="files/is/license.txt">LICEN
 <ul>
   <li>Added <tt>[Setup]</tt> section directive <tt>CloseApplicationsFilterExcludes</tt>.</li>
   <li>Inno Setup is now built using Delphi 12.1 Athens instead of Delphi 11.3 Alexandria.</li>
-  <li>Inno Setup is now signed using a new code signing certificate. The publisher name on this new certificate, Pyrsys B.V., is a company owned by Inno Setup co-developer Martijn Laan.</li>
+  <li>Inno Setup is now signed using a new code signing certificate.</li>
 </ul>
 
 <p><a name="6.4.1"></a><span class="ver">6.4.1 </span><span class="date">(2025-02-12)</span></p>