From ed1f132e8c69d5dc9511c7be817948f00648f53d Mon Sep 17 00:00:00 2001 From: Martijn Laan <1092369+martijnlaan@users.noreply.github.com> Date: Fri, 23 Aug 2024 08:38:14 +0200 Subject: [PATCH] Improve sign flags handling for merged entries. --- Projects/Src/Compiler.SetupCompiler.pas | 10 ++++++---- Projects/Src/Shared.Struct.pas | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Projects/Src/Compiler.SetupCompiler.pas b/Projects/Src/Compiler.SetupCompiler.pas index c5e60b6a5..e98fa22ff 100644 --- a/Projects/Src/Compiler.SetupCompiler.pas +++ b/Projects/Src/Compiler.SetupCompiler.pas @@ -4584,7 +4584,7 @@ procedure TSetupCompiler.EnumFilesProc(const Line: PChar; const Ext: Integer); 'noencryption', 'nocompression', 'dontverifychecksum', 'uninsnosharedfileprompt', 'createallsubdirs', '32bit', '64bit', 'solidbreak', 'setntfscompression', 'unsetntfscompression', - 'sortfilesbyname', 'gacinstall', 'sign', 'signonce', 'signcheck'); + 'sortfilesbyname', 'gacinstall', 'signcheck', 'signonce', 'sign'); SignFlags: array[TSetupFileLocationSign] of String = ( '', 'sign', 'signonce', 'signcheck'); AttribsFlags: array[0..3] of PChar = ( @@ -4911,7 +4911,8 @@ TDirListRec = record Exclude(NewFileLocationEntry^.Flags, foChunkCompressed); if NoEncryption then Exclude(NewFileLocationEntry^.Flags, foChunkEncrypted); - NewFileLocationEntry.Sign := Sign; + if Sign > NewFileLocationEntry.Sign then + NewFileLocationEntry.Sign := Sign; end else begin NewFileEntry^.SourceFilename := SourceFile; @@ -5093,6 +5094,7 @@ TDirListRec = record procedure ApplyNewSign(const NewSign: TSetupFileLocationSign); begin + { Error if there's multiple and different sign flags on the same entry } if not (Sign in [fsNoSetting, NewSign]) then AbortCompileOnLineFmt(SCompilerParamErrorBadCombo2, [ParamCommonFlags, SignFlags[Sign], SignFlags[NewSign]]) @@ -5182,9 +5184,9 @@ TDirListRec = record 35: Include(Options, foUnsetNTFSCompression); 36: SortFilesByName := True; 37: Include(Options, foGacInstall); - 38: ApplyNewSign(fsYes); + 38: ApplyNewSign(fsCheck); 39: ApplyNewSign(fsOnce); - 40: ApplyNewSign(fsCheck); + 40: ApplyNewSign(fsYes); end; { Source } diff --git a/Projects/Src/Shared.Struct.pas b/Projects/Src/Shared.Struct.pas index ee92d844b..c78ef1390 100644 --- a/Projects/Src/Shared.Struct.pas +++ b/Projects/Src/Shared.Struct.pas @@ -33,7 +33,7 @@ interface this file it's recommended you change SetupID. Any change will do (like changing the letters or numbers), as long as your format is unrecognizable by the standard Inno Setup. } - SetupID: TSetupID = 'Inno Setup Setup Data (6.3.0)'; + SetupID: TSetupID = 'Inno Setup Setup Data (6.4.0)'; UninstallLogID: array[Boolean] of TUninstallLogID = ('Inno Setup Uninstall Log (b)', 'Inno Setup Uninstall Log (b) 64-bit'); MessagesHdrID: TMessagesHdrID = 'Inno Setup Messages (6.0.0) (u)'; @@ -241,7 +241,7 @@ interface SetupFileLocationEntryStrings = 0; SetupFileLocationEntryAnsiStrings = 0; type - TSetupFileLocationSign = (fsNoSetting, fsYes, fsOnce, fsCheck); + TSetupFileLocationSign = (fsNoSetting, fsCheck, fsOnce, fsYes); { Must be ordered } PSetupFileLocationEntry = ^TSetupFileLocationEntry; TSetupFileLocationEntry = packed record FirstSlice, LastSlice: Integer;