Browse Source

Add [Setup] section directive CloseApplicationsFilterExcludes and bump version.

Martijn Laan 6 months ago
parent
commit
72756e5787

+ 18 - 1
ISHelp/isetup.xml

@@ -102,7 +102,7 @@
 <body>
 
 <p>
-<b>Inno Setup version 6.4.1</b><br/>
+<b>Inno Setup version 6.4.2-dev</b><br/>
 <b>Copyright &copy; 1997-2025 Jordan Russell. All rights reserved.</b><br/>
 <b>Portions Copyright &copy; 2000-2025 Martijn Laan. All rights reserved.</b><br/>
 <extlink href="https://jrsoftware.org/">Inno Setup home page</extlink>
@@ -1066,6 +1066,7 @@ DefaultGroupName=My Program
 <li><link topic="setup_changesenvironment">ChangesEnvironment</link></li>
 <li><link topic="setup_closeapplications">CloseApplications</link></li>
 <li><link topic="setup_closeapplicationsfilter">CloseApplicationsFilter</link></li>
+<li><link topic="setup_closeapplicationsfilterexcludes">CloseApplicationsFilterExcludes</link></li>
 <li><link topic="setup_createappdir">CreateAppDir</link></li>
 <li><link topic="setup_createuninstallregkey">CreateUninstallRegKey</link></li>
 <li><link topic="setup_defaultdialogfontname">DefaultDialogFontName</link></li>
@@ -5827,6 +5828,22 @@ SignTool=byparam format c:
 <p>Setting this to <tt>*.*</tt> can provide better checking at the expense of speed.</p>
 <p><b>See also:</b><br/>
 <link topic="setup_closeapplications">CloseApplications</link><br/>
+<link topic="setup_closeapplicationsfilterexcludes">CloseApplicationsFilterExcludes</link><br/>
+<link topic="setup_restartapplications">RestartApplications</link></p>
+</body>
+</setuptopic>
+
+<setuptopic directive="CloseApplicationsFilterExcludes">
+<setupvalid>A list of file name wildcards, separated by commas</setupvalid>
+<body>
+<p>Limits which [Files] and [InstallDelete] entries Setup will check for being in use. Files matching one of the wildcards will not be checked even if they match <link topic="setup_closeapplicationsfilter">CloseApplicationsFilter</link>.</p>
+<p>For example, to check all files except MyProg.exe:</p>
+<example><pre>[Setup]
+CloseApplicationsFilter=*.*
+CloseApplicationsFilterExcludes=MyProg.exe</pre></example>
+<p><b>See also:</b><br/>
+<link topic="setup_closeapplications">CloseApplications</link><br/>
+<link topic="setup_closeapplicationsfilter">CloseApplicationsFilter</link><br/>
 <link topic="setup_restartapplications">RestartApplications</link></p>
 </body>
 </setuptopic>

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

@@ -2600,14 +2600,17 @@ begin
           Exclude(SetupHeader.Options, shForceCloseApplications);
         end;
       end;
-    ssCloseApplicationsFilter: begin
+    ssCloseApplicationsFilter, ssCloseApplicationsFilterExcludes: begin
         if Value = '' then
           Invalid;
         AIncludes := TStringList.Create;
         try
           ProcessWildcardsParameter(Value, AIncludes,
-            Format(SCompilerDirectivePatternTooLong, ['CloseApplicationsFilter']));
-          SetupHeader.CloseApplicationsFilter := StringsToCommaString(AIncludes);
+            Format(SCompilerDirectivePatternTooLong, [KeyName]));
+          if Directive = ssCloseApplicationsFilter then
+            SetupHeader.CloseApplicationsFilter := StringsToCommaString(AIncludes)
+          else
+            SetupHeader.CloseApplicationsFilterExcludes := StringsToCommaString(AIncludes);
         finally
           AIncludes.Free;
         end;

+ 14 - 2
Projects/Src/Setup.MainFunc.pas

@@ -110,7 +110,7 @@ var
   Entries: array[TEntryType] of TList;
   WizardImages: TList;
   WizardSmallImages: TList;
-  CloseApplicationsFilterList: TStringList;
+  CloseApplicationsFilterList, CloseApplicationsFilterExcludesList: TStringList;
 
   { User options }
   ActiveLanguage: Integer = -1;
@@ -1915,7 +1915,7 @@ var
 begin
   Filename := AFilename;
 
-  { First: check filter and self. }
+  { First: check filters and self. }
   if Filename <> '' then begin
     CheckFilter := Boolean(Param);
     if CheckFilter then begin
@@ -1927,6 +1927,15 @@ begin
           Break;
         end;
       end;
+      if Match then begin
+        for I := 0 to CloseApplicationsFilterExcludesList.Count-1 do begin
+          if WildcardMatch(PChar(Text), PChar(CloseApplicationsFilterExcludesList[I])) then begin
+            Match := False;
+            Break;
+          end;
+        end;
+      end;
+
       if not Match then begin
         { No match with filter so exit but don't return an error. }
         Result := True;
@@ -3197,6 +3206,7 @@ begin
     if UseRestartManager and (RmStartSession(@RmSessionHandle, 0, RmSessionKey) = ERROR_SUCCESS) then begin
       RmSessionStarted := True;
       SetStringsFromCommaString(CloseApplicationsFilterList, SetupHeader.CloseApplicationsFilter);
+      SetStringsFromCommaString(CloseApplicationsFilterExcludesList, SetupHeader.CloseApplicationsFilterExcludes);
     end;
   end;
 
@@ -3787,6 +3797,7 @@ initialization
   DeleteFilesAfterInstallList := TStringList.Create;
   DeleteDirsAfterInstallList := TStringList.Create;
   CloseApplicationsFilterList := TStringList.Create;
+  CloseApplicationsFilterExcludesList := TStringList.Create;
   WizardImages := TList.Create;
   WizardSmallImages := TList.Create;
   SHGetKnownFolderPathFunc := GetProcAddress(SafeLoadLibrary(AddBackslash(GetSystemDir) + shell32,
@@ -3794,6 +3805,7 @@ initialization
 
 finalization
   FreeWizardImages;
+  FreeAndNil(CloseApplicationsFilterExcludesList);
   FreeAndNil(CloseApplicationsFilterList);
   FreeAndNil(DeleteDirsAfterInstallList);
   FreeAndNil(DeleteFilesAfterInstallList);

+ 2 - 1
Projects/Src/Shared.SetupSectionDirectives.pas

@@ -2,7 +2,7 @@ unit Shared.SetupSectionDirectives;
 
 {
   Inno Setup
-  Copyright (C) 1997-2020 Jordan Russell
+  Copyright (C) 1997-2025 Jordan Russell
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
 
@@ -53,6 +53,7 @@ type
     ssChangesEnvironment,
     ssCloseApplications,
     ssCloseApplicationsFilter,
+    ssCloseApplicationsFilterExcludes,
     ssCompression,
     ssCompressionThreads,
     ssCreateAppDir,

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

@@ -2,7 +2,7 @@ unit Shared.Struct;
 
 {
   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.
 
@@ -17,8 +17,8 @@ uses
 
 const
   SetupTitle = 'Inno Setup';
-  SetupVersion = '6.4.1';
-  SetupBinVersion = (6 shl 24) + (4 shl 16) + (1 shl 8) + 0;
+  SetupVersion = '6.4.2-dev';
+  SetupBinVersion = (6 shl 24) + (4 shl 16) + (2 shl 8) + 0;
 
 type
   TSetupID = array[0..63] of AnsiChar;
@@ -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.4.0.1)';
+  SetupID: TSetupID = 'Inno Setup Setup Data (6.4.2)';
   UninstallLogID: array[Boolean] of TUninstallLogID =
     ('Inno Setup Uninstall Log (b)', 'Inno Setup Uninstall Log (b) 64-bit');
   MessagesHdrID: TMessagesHdrID = 'Inno Setup Messages (6.4.0) (u)';
@@ -86,7 +86,7 @@ const
     ('Unknown', 'x86', 'x64', 'Arm32', 'Arm64');
 
 const
-  SetupHeaderStrings = 32;
+  SetupHeaderStrings = 33;
   SetupHeaderAnsiStrings = 4;
 type
   TSetupHeader = packed record
@@ -97,7 +97,7 @@ type
       DefaultUserInfoSerial, AppReadmeFile, AppContact, AppComments,
       AppModifyPath, CreateUninstallRegKey, Uninstallable, CloseApplicationsFilter,
       SetupMutex, ChangesEnvironment, ChangesAssociations,
-      ArchitecturesAllowed, ArchitecturesInstallIn64BitMode: String;
+      ArchitecturesAllowed, ArchitecturesInstallIn64BitMode, CloseApplicationsFilterExcludes: String;
     LicenseText, InfoBeforeText, InfoAfterText, CompiledCodeText: AnsiString;
     NumLanguageEntries, NumCustomMessageEntries, NumPermissionEntries,
       NumTypeEntries, NumComponentEntries, NumTaskEntries, NumDirEntries,

+ 1 - 1
build-ce.bat

@@ -18,7 +18,7 @@ rem  Once done the installer can be found in Output
 
 setlocal
 
-set VER=6.4.1
+set VER=6.4.2-dev
 
 echo Building Inno Setup %VER%...
 echo.

+ 1 - 1
build.bat

@@ -19,7 +19,7 @@ rem  Once done the installer can be found in Output
 
 setlocal
 
-set VER=6.4.1
+set VER=6.4.2-dev
 
 echo Building Inno Setup %VER%...
 echo.

+ 1 - 1
setup.iss

@@ -13,7 +13,7 @@
 [Setup]
 AppName=Inno Setup
 AppId={code:GetAppId|Inno Setup 6}
-AppVersion=6.4.1
+AppVersion=6.4.2-dev
 AppPublisher=jrsoftware.org
 AppPublisherURL=https://www.innosetup.com/
 AppSupportURL=https://www.innosetup.com/

+ 5 - 0
whatsnew.htm

@@ -29,6 +29,11 @@ For conditions of distribution and use, see <a href="files/is/license.txt">LICEN
 
 <p><b>Want to be notified by e-mail of new Inno Setup releases?</b> <a href="ismail.php">Subscribe</a> to the Inno Setup Mailing List!</p>
 
+<p><a name="6.4.2"></a><span class="ver">6.4.2-dev </span><span class="date">(?)</span></p>
+<ul>
+  <li>Added <tt>[Setup]</tt> section directive <tt>CloseApplicationsFilterExcludes</tt>.</li>
+</ul>
+
 <p><a name="6.4.1"></a><span class="ver">6.4.1 </span><span class="date">(2025-02-12)</span></p>
 <p><span class="head2">Compiler IDE changes</span></p>
 <ul>