浏览代码

Improve sign flags handling for merged entries.

Martijn Laan 1 年之前
父节点
当前提交
ed1f132e8c
共有 2 个文件被更改,包括 8 次插入6 次删除
  1. 6 4
      Projects/Src/Compiler.SetupCompiler.pas
  2. 2 2
      Projects/Src/Shared.Struct.pas

+ 6 - 4
Projects/Src/Compiler.SetupCompiler.pas

@@ -4584,7 +4584,7 @@ const
     '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 @@ type
           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 @@ type
 
   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 @@ begin
                    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 }

+ 2 - 2
Projects/Src/Shared.Struct.pas

@@ -33,7 +33,7 @@ const
     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 @@ const
   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;