Browse Source

Merge branch 'main' into autoreload

# Conflicts:
#	whatsnew.htm
Martijn Laan 1 month ago
parent
commit
746bbfe4cf

+ 3 - 5
Components/ISSigFunc.pas

@@ -102,7 +102,7 @@ function CalcHashToSign(const AIncludeFileNameAndTag: Boolean; const AFileName:
   procedure SHA256UpdateWithString(var Context: TSHA256Context; const S: String);
   begin
     const U = UTF8String(S);
-    const N: Cardinal = Length(U);
+    const N: Int32 = Length(U);
     SHA256Update(Context, N, SizeOf(N));
     if N > 0 then
       SHA256Update(Context, Pointer(U)^, N*SizeOf(U[1]));
@@ -163,11 +163,9 @@ begin
   end;
 
   { Defense-in-depth: Reject any non-CRLF control characters up front, as well
-    as any non-ASCII and non-UTF8-high characters (to avoid any possible issues with
-    converting invalid multibyte characters) }
+    as any byte values that are never used in UTF-8 encoding }
   for var C in U do
-    if not (CharInSet(C, [#10, #13]) or CharInSet(C, NonControlASCIICharsSet) or
-            CharInSet(C, UTF8HighCharsSet)) then
+    if not CharInSet(C, [#10, #13] + NonControlASCIICharsSet + UTF8HighCharsSet) then
       Exit('');
   { Do round-trip check to catch invalid sequences }
   const UTF16Text = String(U);

+ 10 - 6
Components/PathFunc.pas

@@ -19,7 +19,6 @@ function PathCharIsTrailByte(const S: String; const Index: Integer): Boolean;
 function PathCharLength(const S: String; const Index: Integer): Integer;
 function PathCombine(const Dir, Filename: String): String;
 function PathCompare(const S1, S2: String): Integer;
-function PathSame(const S1, S2: String): Boolean;
 function PathDrivePartLength(const Filename: String): Integer;
 function PathDrivePartLengthEx(const Filename: String;
   const IncludeSignificantSlash: Boolean): Integer;
@@ -41,6 +40,7 @@ function PathNormalizeSlashes(const S: String): String;
 function PathPathPartLength(const Filename: String;
   const IncludeSlashesAfterPath: Boolean): Integer;
 function PathPos(Ch: Char; const S: String): Integer;
+function PathSame(const S1, S2: String): Boolean;
 function PathStartsWith(const S, AStartsWith: String): Boolean;
 function PathStrNextChar(const S: PChar): PChar;
 function PathStrPrevChar(const Start, Current: PChar): PChar;
@@ -158,11 +158,6 @@ begin
   Result := CompareStr(PathLowercase(S1), PathLowercase(S2));
 end;
 
-function PathSame(const S1, S2: String): Boolean;
-begin
-  Result := PathCompare(S1, S2) = 0;
-end;
-
 function PathDrivePartLength(const Filename: String): Integer;
 begin
   Result := PathDrivePartLengthEx(Filename, False);
@@ -535,6 +530,15 @@ begin
   end;
 end;
 
+function PathSame(const S1, S2: String): Boolean;
+{ Returns True if the specified strings (typically filenames) are equal, using
+  a case-insensitive ordinal comparison.
+  Like PathCompare, but faster for checking equality as it returns False
+  immediately if the strings are different lengths. }
+begin
+  Result := (Length(S1) = Length(S2)) and (PathCompare(S1, S2) = 0);
+end;
+
 function PathStartsWith(const S, AStartsWith: String): Boolean;
 { Returns True if S starts with (or is equal to) AStartsWith. Uses path casing
   rules. }

+ 1 - 1
ISHelp/isetup.xml

@@ -2519,7 +2519,7 @@ If <tt>binary</tt> is specified, Setup will create a binary (REG_BINARY) value.<
 </param>
 
 <param name="ValueData">
-<p>The data for the value. If the <tt>ValueType</tt> parameter is <tt>string</tt>, <tt>expandsz</tt>, or <tt>multisz</tt>, this is a string that can include constants. If the data type is <tt>dword</tt> or <tt>qword</tt>, this can be a decimal integer (e.g. "123"), a hexadecimal integer (e.g. "$7B"), or a constant which resolves to an integer. Supports digit separators if the data type is <tt>qword</tt>. If the data type is <tt>binary</tt>, this is a sequence of hexadecimal bytes in the form: "00 ff 12 34". If the data type is <tt>none</tt>, this is ignored.</p>
+<p>The data for the value. If the <tt>ValueType</tt> parameter is <tt>string</tt>, <tt>expandsz</tt>, or <tt>multisz</tt>, this is a string that can include constants. If the data type is <tt>dword</tt> or <tt>qword</tt>, this can be a decimal integer (e.g. "123"), a hexadecimal integer (e.g. "$7B"), or a constant which resolves to an integer. If the data type is <tt>binary</tt>, this is a sequence of hexadecimal bytes in the form: "00 ff 12 34". If the data type is <tt>none</tt>, this is ignored.</p>
 <p>On a <tt>string</tt>, <tt>expandsz</tt>, or <tt>multisz</tt> type value, you may use a special constant called <tt>{olddata}</tt> in this parameter. <tt>{olddata}</tt> is replaced with the previous data of the registry value. The <tt>{olddata}</tt> constant can be useful if you need to append a string to an existing value, for example, <tt>{olddata};{app}</tt>. If the value does not exist or the existing value isn't a string type, the {olddata} constant is silently removed. {olddata} will also be silently removed if the value being created is a <tt>multisz</tt> type but the existing value is not a multi-string type (i.e. it's REG_SZ or REG_EXPAND_SZ), and vice versa.</p>
 <p>On a <tt>multisz</tt> type value, you may use a special constant called <tt>{break}</tt> in this parameter to embed line breaks (nulls).</p>
 <example>

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

@@ -4287,16 +4287,15 @@ const
   end;
 
   function ConvertQWordString(const S: String): String;
-  var
-    QW: Integer64;
   begin
     Result := Trim(S);
     { Only check if it doesn't start with a constant }
     if (Result = '') or (Result[1] <> '{') then begin
-      if not StrToInteger64(Result, QW) then
+      var QW: UInt64;
+      if not TryStrToUInt64(Result, QW) then
         AbortCompileParamError(SCompilerParamInvalid2, ParamRegistryValueData);
       { Not really necessary, but sanitize the value }
-      Result := Integer64ToStr(QW);
+      Result := Format('$%x', [QW]);
     end;
   end;
 

+ 19 - 0
Projects/Src/IDE.HelperFunc.pas

@@ -131,6 +131,21 @@ begin
 end;
 
 function InitFormTheme(const Form: TForm): Boolean;
+
+{$IF CompilerVersion >= 36.0}
+  procedure HideGroupBoxFrames(const ParentControl: TWinControl);
+  begin
+    for var I := 0 to ParentControl.ControlCount-1 do begin
+      const Control = ParentControl.Controls[I];
+      if Control is TGroupBox then
+        (Control as TGroupBox).ShowFrame := False;
+
+      if Control is TWinControl then
+        HideGroupBoxFrames(Control as TWinControl);
+    end;
+  end;
+{$ENDIF}
+
 { Assumes forms other then MainForm call this function only once during creation, and assumes they
   don't need any styling if the theme is non dark. Always styles MainForm. Returns True if it did
   style, False otherwise. }
@@ -149,6 +164,10 @@ begin
       DwmSetWindowAttribute(Form.Handle, DWMWA_USE_IMMERSIVE_DARK_MODE, @value, SizeOf(value));
     end;
   end;
+
+{$IF CompilerVersion >= 36.0}
+  HideGroupBoxFrames(Form);
+{$ENDIF}
 end;
 
 function InitFormThemeGetBkColor(const WindowColor: Boolean): TColor;

+ 0 - 6
Projects/Src/IDE.MsgBoxDesignerForm.dfm

@@ -103,7 +103,6 @@ object MsgBoxDesignerForm: TMsgBoxDesignerForm
     Height = 81
     Anchors = [akLeft, akTop, akRight]
     Caption = ' Message '
-    ShowFrame = False
     TabOrder = 0
     DesignSize = (
       532
@@ -125,7 +124,6 @@ object MsgBoxDesignerForm: TMsgBoxDesignerForm
     Width = 240
     Height = 60
     Caption = ' Type'
-    ShowFrame = False
     TabOrder = 6
     object cb_Suppressible: TCheckBox
       Left = 14
@@ -165,7 +163,6 @@ object MsgBoxDesignerForm: TMsgBoxDesignerForm
     Height = 60
     Anchors = [akLeft, akTop, akRight]
     Caption = ' Flags '
-    ShowFrame = False
     TabOrder = 7
     object NewStaticText1: TNewStaticText
       Left = 14
@@ -214,7 +211,6 @@ object MsgBoxDesignerForm: TMsgBoxDesignerForm
     Height = 174
     Anchors = [akLeft, akTop, akBottom]
     Caption = ' Icon '
-    ShowFrame = False
     TabOrder = 8
     DesignSize = (
       160
@@ -422,7 +418,6 @@ object MsgBoxDesignerForm: TMsgBoxDesignerForm
     Height = 174
     Anchors = [akLeft, akTop, akBottom]
     Caption = ' Buttons '
-    ShowFrame = False
     TabOrder = 9
     DesignSize = (
       169
@@ -502,7 +497,6 @@ object MsgBoxDesignerForm: TMsgBoxDesignerForm
     Height = 174
     Anchors = [akLeft, akTop, akBottom]
     Caption = ' Return values '
-    ShowFrame = False
     TabOrder = 10
     object cb_IDOK: TCheckBox
       Left = 16

+ 0 - 3
Projects/Src/IDE.OptionsForm.dfm

@@ -26,7 +26,6 @@ object OptionsForm: TOptionsForm
     Height = 314
     Anchors = [akLeft, akTop, akBottom]
     Caption = ' Miscellaneous '
-    ShowFrame = False
     TabOrder = 0
     object StartupCheck: TCheckBox
       Left = 8
@@ -157,7 +156,6 @@ object OptionsForm: TOptionsForm
     Height = 57
     Anchors = [akLeft, akBottom]
     Caption = ' File Associations '
-    ShowFrame = False
     TabOrder = 1
     DesignSize = (
       281
@@ -180,7 +178,6 @@ object OptionsForm: TOptionsForm
     Height = 372
     Anchors = [akLeft, akTop, akBottom]
     Caption = ' Editor '
-    ShowFrame = False
     TabOrder = 2
     object AutoAutoCompleteCheck: TCheckBox
       Left = 8

+ 0 - 1
Projects/Src/IDE.SignToolsForm.dfm

@@ -25,7 +25,6 @@ object SignToolsForm: TSignToolsForm
     Height = 201
     Anchors = [akLeft, akTop, akRight, akBottom]
     Caption = ' Sign Tools '
-    ShowFrame = False
     TabOrder = 0
     DesignSize = (
       561

+ 0 - 2
Projects/Src/IDE.StartupForm.dfm

@@ -270,7 +270,6 @@ object StartupForm: TStartupForm
     Height = 61
     Anchors = [akLeft, akTop, akRight]
     Caption = ' New file '
-    ShowFrame = False
     TabOrder = 0
     DesignSize = (
       563
@@ -313,7 +312,6 @@ object StartupForm: TStartupForm
     Height = 303
     Anchors = [akLeft, akTop, akRight, akBottom]
     Caption = ' Open file '
-    ShowFrame = False
     TabOrder = 1
     DesignSize = (
       563

+ 0 - 2
Projects/Src/IDE.Wizard.WizardFileForm.dfm

@@ -60,7 +60,6 @@ object WizardFileForm: TWizardFileForm
     Width = 333
     Height = 149
     Caption = ' Destination '
-    ShowFrame = False
     TabOrder = 0
     object DestRootDirLabel: TNewStaticText
       Left = 12
@@ -112,7 +111,6 @@ object WizardFileForm: TWizardFileForm
     Width = 333
     Height = 93
     Caption = ' Source '
-    ShowFrame = False
     TabOrder = 3
     object SourceLabel: TNewStaticText
       Left = 12

+ 1 - 3
Projects/Src/Setup.Install.pas

@@ -2581,7 +2581,6 @@ var
     CurRegNumber: Integer;
     NeedToRetry, DidDeleteKey: Boolean;
     ErrorCode: Longint;
-    QV: Integer64;
     I: Integer;
     AnsiS: AnsiString;
   begin
@@ -2746,8 +2745,7 @@ var
                             RegError(reRegSetValueEx, RK, S, ErrorCode);
                         end;
                       rtQWord: begin
-                          if not StrToInteger64(ExpandConst(ValueData), QV) then
-                            InternalError('Failed to parse "qword" value');
+                          const QV: UInt64 = StrToUInt64(ExpandConst(ValueData));
                           ErrorCode := RegSetValueEx(K, PChar(N), 0, REG_QWORD,
                             @QV, SizeOf(QV));
                           if (ErrorCode <> ERROR_SUCCESS) and

+ 1 - 1
Projects/Src/Shared.TaskDialogFunc.pas

@@ -129,7 +129,7 @@ begin
 
   { Set ButtonIDs and TDCommonButtons }
   const NButtonLabelsAvailable = Length(ButtonLabels);
-  var ButtonIDs: array of Integer;
+  var ButtonIDs: TArray<Integer>;
   var TDCommonButtons: Cardinal;
   case Buttons of
     MB_OK, MB_OKCANCEL:

+ 1 - 1
README.md

@@ -279,7 +279,7 @@ workflow will be triggered automatically.
 To set up automatic synchronization for your fork, first create a Fine-Grained Personal
 Access Token with access to your fork or all repositories you own, ensuring it has Read and
 Write permissions for Contents. After that, add this token as a new repository secret, under
-the name `ISSRC_BUILD_ENV_ZIP_SYNC_TOKEN`. Finally, indicate that your fork has this secret,
+the name `ISSRC_BUILD_ENV_SYNC_TOKEN`. Finally, indicate that your fork has this secret,
 by adding the topic `has-issrc-build-env-sync-token`. Your fork will now synchronize daily,
 and will automatically run the aforementioned build workflow on changes, if it's configured.
 

+ 2 - 3
whatsnew.htm

@@ -210,14 +210,13 @@ issigtool --key-file="MyKey.ispublickey" verify "MyProg.dll"</code></pre>
       <li>The <i>Find in Files</i> result list will now update its line numbers when you add or delete lines.</li>
       <li>The <i>Highlight occurrences of current word</i> option (which is disabled by default) no longer highlights a section's directive names, parameter names, or Pascal keywords.<br/>
           The <i>Highlight occurrences of current selection</i> option (which is enabled by default) still does.</li>
-      <li>Improved dark mode support.</li>
+      <li>Dark mode is now supported throughout.</li>
       <li>Improved support for high-contrast themes.</li>
     </ul>
   </li>
   <li><tt>[Files]</tt> section parameter <tt>Excludes</tt> can now be combined with the <tt>external</tt> flag.</li>
   <li>Increased the maximum value of <tt>[Setup]</tt> section directive <tt>LZMANumBlockThreads</tt> from 32 to 256.</li>
-  <li>Parameters <tt>ExternalSize</tt>, <tt>ExtraDiskSpaceRequired</tt>, and <tt>UninstallDisplaySize</tt> now support digit separators. Example: <tt>UninstallDisplaySize=1_073_741_824</tt>.<br/>
-      The same applies to <tt>[Registry]</tt> parameter <tt>ValueData</tt> if <tt>ValueType</tt> is set to <tt>qword</tt>.</li>
+  <li>Parameters <tt>ExternalSize</tt>, <tt>ExtraDiskSpaceRequired</tt>, and <tt>UninstallDisplaySize</tt> now support digit separators. Example: <tt>UninstallDisplaySize=1_073_741_824</tt>.</li>
   <li>ISPP changes:
     <ul>
       <li>Added predefined variable <tt>__DIR__</tt>. Returns the directory of the current include file.</li>