Pārlūkot izejas kodu

Clarify the name of functions taking a DisableFsRedir parameter but not having the ...Redir name. Especially helps if the call just says False for DisableFsRedir.

Also always set DisableFsRedir to False in InternalExtractTemporaryFile and DownloadTemporaryFile just like it already does for everything else working on the temp dir.
Martijn Laan 3 mēneši atpakaļ
vecāks
revīzija
a1bffc816c

+ 2 - 2
Projects/SetupLdr.dpr

@@ -2,7 +2,7 @@ program SetupLdr;
 
 
 {
 {
   Inno Setup
   Inno Setup
-  Copyright (C) 1997-2024 Jordan Russell
+  Copyright (C) 1997-2025 Jordan Russell
   Portions by Martijn Laan
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
   For conditions of distribution and use, see LICENSE.TXT.
 
 
@@ -509,7 +509,7 @@ begin
         { Even though Setup has terminated by now, the system may still have
         { Even though Setup has terminated by now, the system may still have
           the file locked for a short period of time (esp. on multiprocessor
           the file locked for a short period of time (esp. on multiprocessor
           systems), so use DelayDeleteFile to delete it. }
           systems), so use DelayDeleteFile to delete it. }
-        DelayDeleteFile(False, TempFile, 13, 50, 250);
+        DelayDeleteFileRedir(False, TempFile, 13, 50, 250);
       if TempDir <> '' then
       if TempDir <> '' then
         RemoveDirectory(PChar(TempDir));
         RemoveDirectory(PChar(TempDir));
       if SetupLdrWnd <> 0 then
       if SetupLdrWnd <> 0 then

+ 1 - 1
Projects/Src/Compression.SevenZipDecoder.pas

@@ -277,7 +277,7 @@ begin
   LogFmt('Extracting 7-Zip archive %s to %s. Full paths? %s', [ArchiveFileName, DestDir, SYesNo[FullPaths]]);
   LogFmt('Extracting 7-Zip archive %s to %s. Full paths? %s', [ArchiveFileName, DestDir, SYesNo[FullPaths]]);
 
 
   var SaveCurDir := GetCurrentDir;
   var SaveCurDir := GetCurrentDir;
-  if not ForceDirectories(False, DestDir) or not SetCurrentDir(DestDir) then
+  if not ForceDirectoriesRedir(False, DestDir) or not SetCurrentDir(DestDir) then
     raise Exception.Create(FmtSetupMessage(msgErrorExtractionFailed, ['-1']));
     raise Exception.Create(FmtSetupMessage(msgErrorExtractionFailed, ['-1']));
   try
   try
     State.ExpandedArchiveFileName := PathExpand(ArchiveFileName);
     State.ExpandedArchiveFileName := PathExpand(ArchiveFileName);

+ 23 - 23
Projects/Src/Setup.InstFunc.pas

@@ -47,7 +47,7 @@ type
 function CheckForMutexes(const Mutexes: String): Boolean;
 function CheckForMutexes(const Mutexes: String): Boolean;
 procedure CreateMutexes(const Mutexes: String);
 procedure CreateMutexes(const Mutexes: String);
 function DecrementSharedCount(const RegView: TRegView; const Filename: String): Boolean;
 function DecrementSharedCount(const RegView: TRegView; const Filename: String): Boolean;
-function DelTree(const DisableFsRedir: Boolean; const Path: String;
+function DelTreeRedir(const DisableFsRedir: Boolean; const Path: String;
   const IsDir, DeleteFiles, DeleteSubdirsAlso, BreakOnError: Boolean;
   const IsDir, DeleteFiles, DeleteSubdirsAlso, BreakOnError: Boolean;
   const DeleteDirProc: TDeleteDirProc; const DeleteFileProc: TDeleteFileProc;
   const DeleteDirProc: TDeleteDirProc; const DeleteFileProc: TDeleteFileProc;
   const Param: Pointer): Boolean;
   const Param: Pointer): Boolean;
@@ -56,20 +56,20 @@ procedure EnumFileReplaceOperationsFilenames(const EnumFunc: TEnumFROFilenamesPr
 function GenerateNonRandomUniqueTempDir(const LimitCurrentUserSidAccess: Boolean;
 function GenerateNonRandomUniqueTempDir(const LimitCurrentUserSidAccess: Boolean;
   Path: String; var TempDir: String): Boolean;
   Path: String; var TempDir: String): Boolean;
 function GetComputerNameString: String;
 function GetComputerNameString: String;
-function GetFileDateTime(const DisableFsRedir: Boolean; const Filename: String;
+function GetFileDateTimeRedir(const DisableFsRedir: Boolean; const Filename: String;
   var DateTime: TFileTime): Boolean;
   var DateTime: TFileTime): Boolean;
-function GetSHA256OfFile(const DisableFsRedir: Boolean; const Filename: String): TSHA256Digest;
+function GetSHA256OfFileRedir(const DisableFsRedir: Boolean; const Filename: String): TSHA256Digest;
 function GetSHA256OfAnsiString(const S: AnsiString): TSHA256Digest;
 function GetSHA256OfAnsiString(const S: AnsiString): TSHA256Digest;
 function GetSHA256OfUnicodeString(const S: UnicodeString): TSHA256Digest;
 function GetSHA256OfUnicodeString(const S: UnicodeString): TSHA256Digest;
 function GetRegRootKeyName(const RootKey: HKEY): String;
 function GetRegRootKeyName(const RootKey: HKEY): String;
-function GetSpaceOnDisk(const DisableFsRedir: Boolean; const DriveRoot: String;
+function GetSpaceOnDiskRedir(const DisableFsRedir: Boolean; const DriveRoot: String;
   var FreeBytes, TotalBytes: Integer64): Boolean;
   var FreeBytes, TotalBytes: Integer64): Boolean;
-function GetSpaceOnNearestMountPoint(const DisableFsRedir: Boolean;
+function GetSpaceOnNearestMountPointRedir(const DisableFsRedir: Boolean;
   const StartDir: String; var FreeBytes, TotalBytes: Integer64): Boolean;
   const StartDir: String; var FreeBytes, TotalBytes: Integer64): Boolean;
 function GetUserNameString: String;
 function GetUserNameString: String;
 procedure IncrementSharedCount(const RegView: TRegView; const Filename: String;
 procedure IncrementSharedCount(const RegView: TRegView; const Filename: String;
   const AlreadyExisted: Boolean);
   const AlreadyExisted: Boolean);
-function InstExec(const DisableFsRedir: Boolean; const Filename, Params: String;
+function InstExecRedir(const DisableFsRedir: Boolean; const Filename, Params: String;
   WorkingDir: String; const Wait: TExecWait; const ShowCmd: Integer;
   WorkingDir: String; const Wait: TExecWait; const ShowCmd: Integer;
   const ProcessMessagesProc: TProcedure; const OutputReader: TCreateProcessOutputReader;
   const ProcessMessagesProc: TProcedure; const OutputReader: TCreateProcessOutputReader;
   var ResultCode: Integer): Boolean;
   var ResultCode: Integer): Boolean;
@@ -78,8 +78,8 @@ function InstShellExec(const Verb, Filename, Params: String; WorkingDir: String;
   const ProcessMessagesProc: TProcedure; var ResultCode: Integer): Boolean;
   const ProcessMessagesProc: TProcedure; var ResultCode: Integer): Boolean;
 procedure InternalError(const Id: String);
 procedure InternalError(const Id: String);
 procedure InternalErrorFmt(const S: String; const Args: array of const);
 procedure InternalErrorFmt(const S: String; const Args: array of const);
-function IsDirEmpty(const DisableFsRedir: Boolean; const Dir: String): Boolean;
-function IsProtectedSystemFile(const DisableFsRedir: Boolean;
+function IsDirEmptyRedir(const DisableFsRedir: Boolean; const Dir: String): Boolean;
+function IsProtectedSystemFileRedir(const DisableFsRedir: Boolean;
   const Filename: String): Boolean;
   const Filename: String): Boolean;
 function MakePendingFileRenameOperationsChecksum: TSHA256Digest;
 function MakePendingFileRenameOperationsChecksum: TSHA256Digest;
 function ModifyPifFile(const Filename: String; const CloseOnExit: Boolean): Boolean;
 function ModifyPifFile(const Filename: String; const CloseOnExit: Boolean): Boolean;
@@ -89,11 +89,11 @@ procedure RefreshEnvironment;
 function ReplaceSystemDirWithSysWow64(const Path: String): String;
 function ReplaceSystemDirWithSysWow64(const Path: String): String;
 function ReplaceSystemDirWithSysNative(Path: String; const IsWin64: Boolean): String;
 function ReplaceSystemDirWithSysNative(Path: String; const IsWin64: Boolean): String;
 procedure UnregisterFont(const FontName, FontFilename: String; const PerUserFont: Boolean);
 procedure UnregisterFont(const FontName, FontFilename: String; const PerUserFont: Boolean);
-procedure RestartReplace(const DisableFsRedir: Boolean; TempFile, DestFile: String);
+procedure RestartReplaceRedir(const DisableFsRedir: Boolean; TempFile, DestFile: String);
 procedure SplitNewParamStr(const Index: Integer; var AName, AValue: String);
 procedure SplitNewParamStr(const Index: Integer; var AName, AValue: String);
 procedure Win32ErrorMsg(const FunctionName: String);
 procedure Win32ErrorMsg(const FunctionName: String);
 procedure Win32ErrorMsgEx(const FunctionName: String; const ErrorCode: DWORD);
 procedure Win32ErrorMsgEx(const FunctionName: String; const ErrorCode: DWORD);
-function ForceDirectories(const DisableFsRedir: Boolean; Dir: String): Boolean;
+function ForceDirectoriesRedir(const DisableFsRedir: Boolean; Dir: String): Boolean;
 
 
 implementation
 implementation
 
 
@@ -252,7 +252,7 @@ begin
   Result := Path;
   Result := Path;
 end;
 end;
 
 
-procedure RestartReplace(const DisableFsRedir: Boolean; TempFile, DestFile: String);
+procedure RestartReplaceRedir(const DisableFsRedir: Boolean; TempFile, DestFile: String);
 { Renames TempFile to DestFile the next time Windows is started. If DestFile
 { Renames TempFile to DestFile the next time Windows is started. If DestFile
   already existed, it will be overwritten. If DestFile is '' then TempFile
   already existed, it will be overwritten. If DestFile is '' then TempFile
   will be deleted.. }
   will be deleted.. }
@@ -274,7 +274,7 @@ begin
     Win32ErrorMsg('MoveFileEx');
     Win32ErrorMsg('MoveFileEx');
 end;
 end;
 
 
-function DelTree(const DisableFsRedir: Boolean; const Path: String;
+function DelTreeRedir(const DisableFsRedir: Boolean; const Path: String;
   const IsDir, DeleteFiles, DeleteSubdirsAlso, BreakOnError: Boolean;
   const IsDir, DeleteFiles, DeleteSubdirsAlso, BreakOnError: Boolean;
   const DeleteDirProc: TDeleteDirProc; const DeleteFileProc: TDeleteFileProc;
   const DeleteDirProc: TDeleteDirProc; const DeleteFileProc: TDeleteFileProc;
   const Param: Pointer): Boolean;
   const Param: Pointer): Boolean;
@@ -325,7 +325,7 @@ begin
             end
             end
             else begin
             else begin
               if DeleteSubdirsAlso then
               if DeleteSubdirsAlso then
-                if not DelTree(DisableFsRedir, BasePath + S, True, True, True, BreakOnError,
+                if not DelTreeRedir(DisableFsRedir, BasePath + S, True, True, True, BreakOnError,
                    DeleteDirProc, DeleteFileProc, Param) then
                    DeleteDirProc, DeleteFileProc, Param) then
                   Result := False;
                   Result := False;
             end;
             end;
@@ -348,7 +348,7 @@ begin
   end;
   end;
 end;
 end;
 
 
-function IsDirEmpty(const DisableFsRedir: Boolean; const Dir: String): Boolean;
+function IsDirEmptyRedir(const DisableFsRedir: Boolean; const Dir: String): Boolean;
 { Returns True if Dir contains no files or subdirectories.
 { Returns True if Dir contains no files or subdirectories.
   Note: If Dir does not exist or lacks list permission, False will be
   Note: If Dir does not exist or lacks list permission, False will be
   returned. }
   returned. }
@@ -530,7 +530,7 @@ begin
   end;
   end;
 end;
 end;
 
 
-function GetFileDateTime(const DisableFsRedir: Boolean; const Filename: String;
+function GetFileDateTimeRedir(const DisableFsRedir: Boolean; const Filename: String;
   var DateTime: TFileTime): Boolean;
   var DateTime: TFileTime): Boolean;
 var
 var
   Handle: THandle;
   Handle: THandle;
@@ -550,7 +550,7 @@ begin
   DateTime.dwHighDateTime := 0;
   DateTime.dwHighDateTime := 0;
 end;
 end;
 
 
-function GetSHA256OfFile(const DisableFsRedir: Boolean; const Filename: String): TSHA256Digest;
+function GetSHA256OfFileRedir(const DisableFsRedir: Boolean; const Filename: String): TSHA256Digest;
 { Gets SHA-256 sum as a string of the file Filename. An exception will be raised upon
 { Gets SHA-256 sum as a string of the file Filename. An exception will be raised upon
   failure. }
   failure. }
 var
 var
@@ -586,7 +586,7 @@ var
   SFCInitialized: Boolean;
   SFCInitialized: Boolean;
   SfcIsFileProtectedFunc: function(RpcHandle: THandle; ProtFileName: PWideChar): BOOL; stdcall;
   SfcIsFileProtectedFunc: function(RpcHandle: THandle; ProtFileName: PWideChar): BOOL; stdcall;
 
 
-function IsProtectedSystemFile(const DisableFsRedir: Boolean;
+function IsProtectedSystemFileRedir(const DisableFsRedir: Boolean;
   const Filename: String): Boolean;
   const Filename: String): Boolean;
 { Returns True if the specified file is protected by Windows File Protection
 { Returns True if the specified file is protected by Windows File Protection
   (and therefore can't be replaced). }
   (and therefore can't be replaced). }
@@ -656,7 +656,7 @@ begin
   end;
   end;
 end;
 end;
 
 
-function InstExec(const DisableFsRedir: Boolean; const Filename, Params: String;
+function InstExecRedir(const DisableFsRedir: Boolean; const Filename, Params: String;
   WorkingDir: String; const Wait: TExecWait; const ShowCmd: Integer;
   WorkingDir: String; const Wait: TExecWait; const ShowCmd: Integer;
   const ProcessMessagesProc: TProcedure; const OutputReader: TCreateProcessOutputReader;
   const ProcessMessagesProc: TProcedure; const OutputReader: TCreateProcessOutputReader;
   var ResultCode: Integer): Boolean;
   var ResultCode: Integer): Boolean;
@@ -950,7 +950,7 @@ begin
     SendNotifyMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);
     SendNotifyMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);
 end;
 end;
 
 
-function GetSpaceOnDisk(const DisableFsRedir: Boolean; const DriveRoot: String;
+function GetSpaceOnDiskRedir(const DisableFsRedir: Boolean; const DriveRoot: String;
   var FreeBytes, TotalBytes: Integer64): Boolean;
   var FreeBytes, TotalBytes: Integer64): Boolean;
 var
 var
   GetDiskFreeSpaceExFunc: function(lpDirectoryName: PChar;
   GetDiskFreeSpaceExFunc: function(lpDirectoryName: PChar;
@@ -993,7 +993,7 @@ begin
   end;
   end;
 end;
 end;
 
 
-function GetSpaceOnNearestMountPoint(const DisableFsRedir: Boolean;
+function GetSpaceOnNearestMountPointRedir(const DisableFsRedir: Boolean;
   const StartDir: String; var FreeBytes, TotalBytes: Integer64): Boolean;
   const StartDir: String; var FreeBytes, TotalBytes: Integer64): Boolean;
 { Gets the free and total space available on the specified directory. If that
 { Gets the free and total space available on the specified directory. If that
   fails (e.g. if the directory does not exist), then it strips off the last
   fails (e.g. if the directory does not exist), then it strips off the last
@@ -1007,7 +1007,7 @@ begin
   Dir := RemoveBackslashUnlessRoot(StartDir);
   Dir := RemoveBackslashUnlessRoot(StartDir);
   LastLen := 0;
   LastLen := 0;
   while Length(Dir) <> LastLen do begin
   while Length(Dir) <> LastLen do begin
-    if GetSpaceOnDisk(DisableFsRedir, Dir, FreeBytes, TotalBytes) then begin
+    if GetSpaceOnDiskRedir(DisableFsRedir, Dir, FreeBytes, TotalBytes) then begin
       Result := True;
       Result := True;
       Break;
       Break;
     end;
     end;
@@ -1053,13 +1053,13 @@ begin
   AValue := '';
   AValue := '';
 end;
 end;
 
 
-function ForceDirectories(const DisableFsRedir: Boolean; Dir: String): Boolean;
+function ForceDirectoriesRedir(const DisableFsRedir: Boolean; Dir: String): Boolean;
 begin
 begin
   Dir := RemoveBackslashUnlessRoot(Dir);
   Dir := RemoveBackslashUnlessRoot(Dir);
   if (PathExtractPath(Dir) = Dir) or DirExistsRedir(DisableFsRedir, Dir) then
   if (PathExtractPath(Dir) = Dir) or DirExistsRedir(DisableFsRedir, Dir) then
     Result := True
     Result := True
   else
   else
-    Result := ForceDirectories(DisableFsRedir, PathExtractPath(Dir)) and
+    Result := ForceDirectoriesRedir(DisableFsRedir, PathExtractPath(Dir)) and
       CreateDirectoryRedir(DisableFsRedir, Dir);
       CreateDirectoryRedir(DisableFsRedir, Dir);
 end;
 end;
 
 

+ 50 - 51
Projects/Src/Setup.Install.pas

@@ -238,12 +238,12 @@ begin
     Result := '(invalid)';
     Result := '(invalid)';
 end;
 end;
 
 
-function TryToGetSHA256OfFile(const DisableFsRedir: Boolean; const Filename: String;
+function TryToGetSHA256OfFileRedir(const DisableFsRedir: Boolean; const Filename: String;
   var Sum: TSHA256Digest): Boolean;
   var Sum: TSHA256Digest): Boolean;
 { Like GetSHA256OfFile but traps exceptions locally. Returns True if successful. }
 { Like GetSHA256OfFile but traps exceptions locally. Returns True if successful. }
 begin
 begin
   try
   try
-    Sum := GetSHA256OfFile(DisableFsRedir, Filename);
+    Sum := GetSHA256OfFileRedir(DisableFsRedir, Filename);
     Result := True;
     Result := True;
   except
   except
     Result := False;
     Result := False;
@@ -349,7 +349,7 @@ begin
   SetProgress(AMaxProgress);
   SetProgress(AMaxProgress);
 end;
 end;
 
 
-procedure AddAttributesToFile(const DisableFsRedir: Boolean;
+procedure AddAttributesToFileRedir(const DisableFsRedir: Boolean;
   const Filename: String; Attribs: Integer);
   const Filename: String; Attribs: Integer);
 var
 var
   ExistingAttr: DWORD;
   ExistingAttr: DWORD;
@@ -804,7 +804,7 @@ var
   type
   type
     TMakeDirFlags = set of (mdNoUninstall, mdAlwaysUninstall, mdDeleteAfterInstall,
     TMakeDirFlags = set of (mdNoUninstall, mdAlwaysUninstall, mdDeleteAfterInstall,
       mdNotifyChange);
       mdNotifyChange);
-  function MakeDir(const DisableFsRedir: Boolean; Dir: String;
+  function MakeDirRedir(const DisableFsRedir: Boolean; Dir: String;
     const Flags: TMakeDirFlags): Boolean;
     const Flags: TMakeDirFlags): Boolean;
   { Returns True if a new directory was created.
   { Returns True if a new directory was created.
     Note: If DisableFsRedir is True, the mdNotifyChange flag should not be
     Note: If DisableFsRedir is True, the mdNotifyChange flag should not be
@@ -822,7 +822,7 @@ var
         Exit;
         Exit;
     end
     end
     else begin
     else begin
-      MakeDir(DisableFsRedir, PathExtractDir(Dir), Flags - [mdAlwaysUninstall]);
+      MakeDirRedir(DisableFsRedir, PathExtractDir(Dir), Flags - [mdAlwaysUninstall]);
       LogFmt('Creating directory: %s', [Dir]);
       LogFmt('Creating directory: %s', [Dir]);
       if not CreateDirectoryRedir(DisableFsRedir, Dir) then begin
       if not CreateDirectoryRedir(DisableFsRedir, Dir) then begin
         ErrorCode := GetLastError;
         ErrorCode := GetLastError;
@@ -854,7 +854,7 @@ var
   procedure CreateDirs;
   procedure CreateDirs;
   { Creates the application's directories }
   { Creates the application's directories }
 
 
-    procedure ApplyPermissions(const DisableFsRedir: Boolean;
+    procedure ApplyPermissionsRedir(const DisableFsRedir: Boolean;
       const Filename: String; const PermsEntry: Integer);
       const Filename: String; const PermsEntry: Integer);
     var
     var
       P: PSetupPermissionEntry;
       P: PSetupPermissionEntry;
@@ -862,14 +862,14 @@ var
       if PermsEntry <> -1 then begin
       if PermsEntry <> -1 then begin
         LogFmt('Setting permissions on directory: %s', [Filename]);
         LogFmt('Setting permissions on directory: %s', [Filename]);
         P := Entries[sePermission][PermsEntry];
         P := Entries[sePermission][PermsEntry];
-        if not GrantPermissionOnFile(DisableFsRedir, Filename,
+        if not GrantPermissionOnFileRedir(DisableFsRedir, Filename,
            TGrantPermissionEntry(Pointer(P.Permissions)^),
            TGrantPermissionEntry(Pointer(P.Permissions)^),
            Length(P.Permissions) div SizeOf(TGrantPermissionEntry)) then
            Length(P.Permissions) div SizeOf(TGrantPermissionEntry)) then
           LogFmt('Failed to set permissions on directory (%d).', [GetLastError]);
           LogFmt('Failed to set permissions on directory (%d).', [GetLastError]);
       end;
       end;
     end;
     end;
 
 
-    procedure ApplyNTFSCompression(const DisableFsRedir: Boolean;
+    procedure ApplyNTFSCompressionRedir(const DisableFsRedir: Boolean;
       const Filename: String; const Compress: Boolean);
       const Filename: String; const Compress: Boolean);
     begin
     begin
       if Compress then
       if Compress then
@@ -886,7 +886,7 @@ var
     N: String;
     N: String;
   begin
   begin
     { Create main application directory }
     { Create main application directory }
-    MakeDir(InstallDefaultDisableFsRedir, WizardDirValue, []);
+    MakeDirRedir(InstallDefaultDisableFsRedir, WizardDirValue, []);
 
 
     { Create the rest of the directories, if any }
     { Create the rest of the directories, if any }
     for CurDirNumber := 0 to Entries[seDir].Count-1 do
     for CurDirNumber := 0 to Entries[seDir].Count-1 do
@@ -899,11 +899,11 @@ var
           if doDeleteAfterInstall in Options then Include(Flags, mdDeleteAfterInstall);
           if doDeleteAfterInstall in Options then Include(Flags, mdDeleteAfterInstall);
           if doUninsAlwaysUninstall in Options then Include(Flags, mdAlwaysUninstall);
           if doUninsAlwaysUninstall in Options then Include(Flags, mdAlwaysUninstall);
           N := RemoveBackslashUnlessRoot(PathExpand(ExpandConst(DirName)));
           N := RemoveBackslashUnlessRoot(PathExpand(ExpandConst(DirName)));
-          MakeDir(InstallDefaultDisableFsRedir, N, Flags);
-          AddAttributesToFile(InstallDefaultDisableFsRedir, N, Attribs);
-          ApplyPermissions(InstallDefaultDisableFsRedir, N, PermissionsEntry);
+          MakeDirRedir(InstallDefaultDisableFsRedir, N, Flags);
+          AddAttributesToFileRedir(InstallDefaultDisableFsRedir, N, Attribs);
+          ApplyPermissionsRedir(InstallDefaultDisableFsRedir, N, PermissionsEntry);
           if (doSetNTFSCompression in Options) or (doUnsetNTFSCompression in Options) then
           if (doSetNTFSCompression in Options) or (doUnsetNTFSCompression in Options) then
-            ApplyNTFSCompression(InstallDefaultDisableFsRedir, N, doSetNTFSCompression in Options);
+            ApplyNTFSCompressionRedir(InstallDefaultDisableFsRedir, N, doSetNTFSCompression in Options);
           NotifyAfterInstallEntry(AfterInstall);
           NotifyAfterInstallEntry(AfterInstall);
         end;
         end;
       end;
       end;
@@ -1043,7 +1043,7 @@ var
       FileLocationFilenames.Objects[LocationEntry] := Pointer(Hash);
       FileLocationFilenames.Objects[LocationEntry] := Pointer(Hash);
     end;
     end;
 
 
-    procedure ApplyPermissions(const DisableFsRedir: Boolean;
+    procedure ApplyPermissionsRedir(const DisableFsRedir: Boolean;
       const Filename: String; const PermsEntry: Integer);
       const Filename: String; const PermsEntry: Integer);
     var
     var
       Attr: DWORD;
       Attr: DWORD;
@@ -1054,7 +1054,7 @@ var
         if (Attr <> INVALID_FILE_ATTRIBUTES) and (Attr and FILE_ATTRIBUTE_DIRECTORY = 0) then begin
         if (Attr <> INVALID_FILE_ATTRIBUTES) and (Attr and FILE_ATTRIBUTE_DIRECTORY = 0) then begin
           LogFmt('Setting permissions on file: %s', [Filename]);
           LogFmt('Setting permissions on file: %s', [Filename]);
           P := Entries[sePermission][PermsEntry];
           P := Entries[sePermission][PermsEntry];
-          if not GrantPermissionOnFile(DisableFsRedir, Filename,
+          if not GrantPermissionOnFileRedir(DisableFsRedir, Filename,
              TGrantPermissionEntry(Pointer(P.Permissions)^),
              TGrantPermissionEntry(Pointer(P.Permissions)^),
              Length(P.Permissions) div SizeOf(TGrantPermissionEntry)) then
              Length(P.Permissions) div SizeOf(TGrantPermissionEntry)) then
             LogFmt('Failed to set permissions on file (%d).', [GetLastError]);
             LogFmt('Failed to set permissions on file (%d).', [GetLastError]);
@@ -1062,7 +1062,7 @@ var
       end;
       end;
     end;
     end;
 
 
-    procedure ApplyNTFSCompression(const DisableFsRedir: Boolean;
+    procedure ApplyNTFSCompressionRedir(const DisableFsRedir: Boolean;
       const Filename: String; const Compress: Boolean);
       const Filename: String; const Compress: Boolean);
     begin
     begin
       if Compress then
       if Compress then
@@ -1085,7 +1085,7 @@ var
           'Will replace on restart.', [Func, LastError]);
           'Will replace on restart.', [Func, LastError]);
         LastOperation := SetupMessages[msgErrorRestartReplace];
         LastOperation := SetupMessages[msgErrorRestartReplace];
         NeedsRestart := True;
         NeedsRestart := True;
-        RestartReplace(DisableFsRedir, TempFile, DestFile);
+        RestartReplaceRedir(DisableFsRedir, TempFile, DestFile);
         ReplaceOnRestart := True;
         ReplaceOnRestart := True;
         DoBreak := True;
         DoBreak := True;
         DoContinue := False;
         DoContinue := False;
@@ -1213,7 +1213,7 @@ var
         end;
         end;
 
 
         { See if it's a protected system file.  }
         { See if it's a protected system file.  }
-        if IsProtectedSystemFile(DisableFsRedir, DestFile) then begin
+        if IsProtectedSystemFileRedir(DisableFsRedir, DestFile) then begin
           Log('Dest file is protected by Windows File Protection.');
           Log('Dest file is protected by Windows File Protection.');
           IsProtectedFile := (CurFile^.FileType = ftUserFile);
           IsProtectedFile := (CurFile^.FileType = ftUserFile);
         end else
         end else
@@ -1235,7 +1235,7 @@ var
           CurFileDateValid := True;
           CurFileDateValid := True;
         end
         end
         else
         else
-          CurFileDateValid := GetFileDateTime(DisableFsRedir, ASourceFile, CurFileDate);
+          CurFileDateValid := GetFileDateTimeRedir(DisableFsRedir, ASourceFile, CurFileDate);
         if CurFileDateValid then
         if CurFileDateValid then
           LogFmt('Time stamp of our file: %s', [FileTimeToStr(CurFileDate)])
           LogFmt('Time stamp of our file: %s', [FileTimeToStr(CurFileDate)])
         else
         else
@@ -1250,7 +1250,7 @@ var
 
 
           LastOperation := SetupMessages[msgErrorReadingExistingDest];
           LastOperation := SetupMessages[msgErrorReadingExistingDest];
 
 
-          ExistingFileDateValid := GetFileDateTime(DisableFsRedir, DestFile, ExistingFileDate);
+          ExistingFileDateValid := GetFileDateTimeRedir(DisableFsRedir, DestFile, ExistingFileDate);
           if ExistingFileDateValid then
           if ExistingFileDateValid then
             LogFmt('Time stamp of existing file: %s', [FileTimeToStr(ExistingFileDate)])
             LogFmt('Time stamp of existing file: %s', [FileTimeToStr(ExistingFileDate)])
           else
           else
@@ -1311,7 +1311,7 @@ var
                    not(foOverwriteSameVersion in CurFile^.Options) then begin
                    not(foOverwriteSameVersion in CurFile^.Options) then begin
                   if foReplaceSameVersionIfContentsDiffer in CurFile^.Options then begin
                   if foReplaceSameVersionIfContentsDiffer in CurFile^.Options then begin
                     { Get the two files' SHA-256 hashes and compare them }
                     { Get the two files' SHA-256 hashes and compare them }
-                    if TryToGetSHA256OfFile(DisableFsRedir, DestFile, ExistingFileHash) then begin
+                    if TryToGetSHA256OfFileRedir(DisableFsRedir, DestFile, ExistingFileHash) then begin
                       if Assigned(CurFileLocation) then
                       if Assigned(CurFileLocation) then
                         CurFileHash := CurFileLocation^.SHA256Sum
                         CurFileHash := CurFileLocation^.SHA256Sum
                       else begin
                       else begin
@@ -1319,7 +1319,7 @@ var
                         { This GetSHA256OfFile call could raise an exception, but
                         { This GetSHA256OfFile call could raise an exception, but
                           it's very unlikely since we were already able to
                           it's very unlikely since we were already able to
                           successfully read the file's version info. }
                           successfully read the file's version info. }
-                        CurFileHash := GetSHA256OfFile(DisableFsRedir, ASourceFile);
+                        CurFileHash := GetSHA256OfFileRedir(DisableFsRedir, ASourceFile);
                         LastOperation := SetupMessages[msgErrorReadingExistingDest];
                         LastOperation := SetupMessages[msgErrorReadingExistingDest];
                       end;
                       end;
                       { If the two files' SHA-256 hashes are equal, skip the file }
                       { If the two files' SHA-256 hashes are equal, skip the file }
@@ -1474,11 +1474,11 @@ var
         { Extract or copy the file to a temporary file. Create the destination
         { Extract or copy the file to a temporary file. Create the destination
           file's directory if it didn't already exist. }
           file's directory if it didn't already exist. }
         LastOperation := SetupMessages[msgErrorCreatingTemp];
         LastOperation := SetupMessages[msgErrorCreatingTemp];
-        TempFile := GenerateUniqueName(DisableFsRedir, PathExtractPath(DestFile), '.tmp');
+        TempFile := GenerateUniqueNameRedir(DisableFsRedir, PathExtractPath(DestFile), '.tmp');
         Flags := [];
         Flags := [];
         if foUninsNeverUninstall in CurFile^.Options then Include(Flags, mdNoUninstall);
         if foUninsNeverUninstall in CurFile^.Options then Include(Flags, mdNoUninstall);
         if foDeleteAfterInstall in CurFile^.Options then Include(Flags, mdDeleteAfterInstall);
         if foDeleteAfterInstall in CurFile^.Options then Include(Flags, mdDeleteAfterInstall);
-        MakeDir(DisableFsRedir, PathExtractDir(TempFile), Flags);
+        MakeDirRedir(DisableFsRedir, PathExtractDir(TempFile), Flags);
         DestF := TFileRedir.Create(DisableFsRedir, TempFile, fdCreateAlways, faReadWrite, fsNone);
         DestF := TFileRedir.Create(DisableFsRedir, TempFile, fdCreateAlways, faReadWrite, fsNone);
         try
         try
           TempFileLeftOver := True;
           TempFileLeftOver := True;
@@ -1609,7 +1609,7 @@ var
               DeleteFilesAfterInstallList.AddObject(DestFile, Pointer(Ord(DisableFsRedir)));
               DeleteFilesAfterInstallList.AddObject(DestFile, Pointer(Ord(DisableFsRedir)));
             { Set file attributes *after* renaming the file since Novell
             { Set file attributes *after* renaming the file since Novell
               reportedly can't rename read-only files. }
               reportedly can't rename read-only files. }
-            AddAttributesToFile(DisableFsRedir, DestFile, CurFile^.Attribs);
+            AddAttributesToFileRedir(DisableFsRedir, DestFile, CurFile^.Attribs);
           end;
           end;
         end;
         end;
 
 
@@ -1625,7 +1625,7 @@ var
           Log('Leaving temporary file in place for now.');
           Log('Leaving temporary file in place for now.');
           if AllowFileToBeDuplicated then
           if AllowFileToBeDuplicated then
             SetFileLocationFilename(CurFile^.LocationEntry, TempFile);
             SetFileLocationFilename(CurFile^.LocationEntry, TempFile);
-          AddAttributesToFile(DisableFsRedir, TempFile, CurFile^.Attribs);
+          AddAttributesToFileRedir(DisableFsRedir, TempFile, CurFile^.Attribs);
         end;
         end;
 
 
         { If it's a font, register it }
         { If it's a font, register it }
@@ -1716,17 +1716,17 @@ var
         { Apply permissions (even if the file wasn't replaced) }
         { Apply permissions (even if the file wasn't replaced) }
         LastOperation := '';
         LastOperation := '';
         if TempFile <> '' then
         if TempFile <> '' then
-          ApplyPermissions(DisableFsRedir, TempFile, CurFile^.PermissionsEntry)
+          ApplyPermissionsRedir(DisableFsRedir, TempFile, CurFile^.PermissionsEntry)
         else
         else
-          ApplyPermissions(DisableFsRedir, DestFile, CurFile^.PermissionsEntry);
+          ApplyPermissionsRedir(DisableFsRedir, DestFile, CurFile^.PermissionsEntry);
 
 
         { Set NTFS compression (even if the file wasn't replaced) }
         { Set NTFS compression (even if the file wasn't replaced) }
         if (foSetNTFSCompression in CurFile^.Options) or (foUnsetNTFSCompression in CurFile^.Options) then begin
         if (foSetNTFSCompression in CurFile^.Options) or (foUnsetNTFSCompression in CurFile^.Options) then begin
           LastOperation := '';
           LastOperation := '';
           if TempFile <> '' then
           if TempFile <> '' then
-            ApplyNTFSCompression(DisableFsRedir, TempFile, foSetNTFSCompression in CurFile^.Options)
+            ApplyNTFSCompressionRedir(DisableFsRedir, TempFile, foSetNTFSCompression in CurFile^.Options)
           else
           else
-            ApplyNTFSCompression(DisableFsRedir, DestFile, foSetNTFSCompression in CurFile^.Options);
+            ApplyNTFSCompressionRedir(DisableFsRedir, DestFile, foSetNTFSCompression in CurFile^.Options);
         end;
         end;
 
 
         { Install into GAC (even if the file wasn't replaced) }
         { Install into GAC (even if the file wasn't replaced) }
@@ -1789,7 +1789,7 @@ var
   procedure CopyFiles(const Uninstallable: Boolean);
   procedure CopyFiles(const Uninstallable: Boolean);
   { Copies all the application's files }
   { Copies all the application's files }
 
 
-    function RecurseExternalCopyFiles(const DisableFsRedir: Boolean;
+    function RecurseExternalCopyFilesRedir(const DisableFsRedir: Boolean;
       const SearchBaseDir, SearchSubDir, SearchWildcard: String; const SourceIsWildcard: Boolean;
       const SearchBaseDir, SearchSubDir, SearchWildcard: String; const SourceIsWildcard: Boolean;
       const Excludes: TStringList; const CurFile: PSetupFileEntry; const FileLocationFilenames: TStringList;
       const Excludes: TStringList; const CurFile: PSetupFileEntry; const FileLocationFilenames: TStringList;
       var ExpectedBytesLeft: Integer64; var ConfirmOverwriteOverwriteAll, PromptIfOlderOverwriteAll: TOverwriteAll;
       var ExpectedBytesLeft: Integer64; var ConfirmOverwriteOverwriteAll, PromptIfOlderOverwriteAll: TOverwriteAll;
@@ -1853,7 +1853,7 @@ var
           try
           try
             repeat
             repeat
               if IsRecurseableDirectory(FindData) then
               if IsRecurseableDirectory(FindData) then
-                Result := RecurseExternalCopyFiles(DisableFsRedir, SearchBaseDir,
+                Result := RecurseExternalCopyFilesRedir(DisableFsRedir, SearchBaseDir,
                   SearchSubDir + FindData.cFileName + '\', SearchWildcard,
                   SearchSubDir + FindData.cFileName + '\', SearchWildcard,
                   SourceIsWildcard, Excludes, CurFile, FileLocationFileNames,
                   SourceIsWildcard, Excludes, CurFile, FileLocationFileNames,
                   ExpectedBytesLeft, ConfirmOverwriteOverwriteAll, PromptIfOlderOverwriteAll,
                   ExpectedBytesLeft, ConfirmOverwriteOverwriteAll, PromptIfOlderOverwriteAll,
@@ -1877,7 +1877,7 @@ var
           Flags := [];
           Flags := [];
           if foUninsNeverUninstall in CurFile^.Options then Include(Flags, mdNoUninstall);
           if foUninsNeverUninstall in CurFile^.Options then Include(Flags, mdNoUninstall);
           if foDeleteAfterInstall in CurFile^.Options then Include(Flags, mdDeleteAfterInstall);
           if foDeleteAfterInstall in CurFile^.Options then Include(Flags, mdDeleteAfterInstall);
-          MakeDir(DisableFsRedir, DestName, Flags);
+          MakeDirRedir(DisableFsRedir, DestName, Flags);
           Result := True;
           Result := True;
         end;
         end;
       end;
       end;
@@ -1950,7 +1950,7 @@ var
             repeat
             repeat
               SetProgress(ProgressBefore);
               SetProgress(ProgressBefore);
               ExpectedBytesLeft := CurFile^.ExternalSize;
               ExpectedBytesLeft := CurFile^.ExternalSize;
-              FoundFiles := RecurseExternalCopyFiles(DisableFsRedir,
+              FoundFiles := RecurseExternalCopyFilesRedir(DisableFsRedir,
                 PathExtractPath(SourceWildcard), '', PathExtractName(SourceWildcard),
                 PathExtractPath(SourceWildcard), '', PathExtractName(SourceWildcard),
                 IsWildcard(SourceWildcard), Excludes, CurFile, FileLocationFileNames,
                 IsWildcard(SourceWildcard), Excludes, CurFile, FileLocationFileNames,
                 ExpectedBytesLeft, ConfirmOverwriteOverwriteAll, PromptIfOlderOverwriteAll,
                 ExpectedBytesLeft, ConfirmOverwriteOverwriteAll, PromptIfOlderOverwriteAll,
@@ -2072,7 +2072,7 @@ var
         ProbableFilename := LinkFilename;
         ProbableFilename := LinkFilename;
       LogFmt('Dest filename: %s', [ProbableFilename]);
       LogFmt('Dest filename: %s', [ProbableFilename]);
       SetFilenameLabelText(ProbableFilename, True);
       SetFilenameLabelText(ProbableFilename, True);
-      MakeDir(False, PathExtractDir(ProbableFilename), Flags);
+      MakeDirRedir(False, PathExtractDir(ProbableFilename), Flags);
 
 
       { Delete any old files first }
       { Delete any old files first }
       DeleteFile(LinkFilename);
       DeleteFile(LinkFilename);
@@ -2234,7 +2234,7 @@ var
             if IniDir <> '' then begin
             if IniDir <> '' then begin
               while True do begin
               while True do begin
                 try
                 try
-                  MakeDir(False, IniDir, []);
+                  MakeDirRedir(False, IniDir, []);
                   Break;
                   Break;
                 except
                 except
                   if AbortRetryIgnoreTaskDialogMsgBox(
                   if AbortRetryIgnoreTaskDialogMsgBox(
@@ -2569,7 +2569,7 @@ var
         NumRead: Cardinal;
         NumRead: Cardinal;
         Buf: array[0..16383] of Byte;
         Buf: array[0..16383] of Byte;
       begin
       begin
-        ExeFilename := GenerateUniqueName(False, Dir, '.exe');
+        ExeFilename := GenerateUniqueNameRedir(False, Dir, '.exe');
         DestF := nil;
         DestF := nil;
         SourceF := TFile.Create(NewParamStr(0), fdOpenExisting, faRead, fsRead);
         SourceF := TFile.Create(NewParamStr(0), fdOpenExisting, faRead, fsRead);
         try
         try
@@ -2794,10 +2794,10 @@ var
           NotifyBeforeInstallEntry(BeforeInstall);
           NotifyBeforeInstallEntry(BeforeInstall);
           case DeleteType of
           case DeleteType of
             dfFiles, dfFilesAndOrSubdirs:
             dfFiles, dfFilesAndOrSubdirs:
-              DelTree(InstallDefaultDisableFsRedir, ExpandConst(Name), False, True, DeleteType = dfFilesAndOrSubdirs, False,
+              DelTreeRedir(InstallDefaultDisableFsRedir, ExpandConst(Name), False, True, DeleteType = dfFilesAndOrSubdirs, False,
                 nil, nil, nil);
                 nil, nil, nil);
             dfDirIfEmpty:
             dfDirIfEmpty:
-              DelTree(InstallDefaultDisableFsRedir, ExpandConst(Name), True, False, False, False, nil, nil, nil);
+              DelTreeRedir(InstallDefaultDisableFsRedir, ExpandConst(Name), True, False, False, False, nil, nil, nil);
           end;
           end;
           NotifyAfterInstallEntry(AfterInstall);
           NotifyAfterInstallEntry(AfterInstall);
         end;
         end;
@@ -2940,7 +2940,7 @@ var
       when using a 64-bit Uninstall key) }
       when using a 64-bit Uninstall key) }
     BaseDir := ReplaceSystemDirWithSysWow64(PathExpand(ExpandConst(SetupHeader.UninstallFilesDir)));
     BaseDir := ReplaceSystemDirWithSysWow64(PathExpand(ExpandConst(SetupHeader.UninstallFilesDir)));
     LogFmt('Directory for uninstall files: %s', [BaseDir]);
     LogFmt('Directory for uninstall files: %s', [BaseDir]);
-    MakeDir(False, BaseDir, []);
+    MakeDirRedir(False, BaseDir, []);
 
 
     FillChar(ExistingFiles, SizeOf(ExistingFiles), 0);  { set all to False }
     FillChar(ExistingFiles, SizeOf(ExistingFiles), 0);  { set all to False }
     FindFiles;
     FindFiles;
@@ -3358,7 +3358,6 @@ procedure InternalExtractTemporaryFile(const DestName: String;
   const CurFile: PSetupFileEntry; const CurFileLocation: PSetupFileLocationEntry;
   const CurFile: PSetupFileEntry; const CurFileLocation: PSetupFileLocationEntry;
   const CreateDirs: Boolean);
   const CreateDirs: Boolean);
 var
 var
-  DisableFsRedir: Boolean;
   DestFile: String;
   DestFile: String;
   DestF: TFile;
   DestF: TFile;
   CurFileDate: TFileTime;
   CurFileDate: TFileTime;
@@ -3367,9 +3366,10 @@ begin
 
 
   Log('Extracting temporary file: ' + DestFile);
   Log('Extracting temporary file: ' + DestFile);
 
 
-  DisableFsRedir := InstallDefaultDisableFsRedir;
+  const DisableFsRedir = False; { Like everything else working on the temp dir }
+
   if CreateDirs then
   if CreateDirs then
-    ForceDirectories(DisableFsRedir, PathExtractPath(DestFile));
+    ForceDirectoriesRedir(DisableFsRedir, PathExtractPath(DestFile));
   DestF := TFileRedir.Create(DisableFsRedir, DestFile, fdCreateAlways, faWrite, fsNone);
   DestF := TFileRedir.Create(DisableFsRedir, DestFile, fdCreateAlways, faWrite, fsNone);
   try
   try
     try
     try
@@ -3389,7 +3389,7 @@ begin
     DeleteFileRedir(DisableFsRedir, DestFile);
     DeleteFileRedir(DisableFsRedir, DestFile);
     raise;
     raise;
   end;
   end;
-  AddAttributesToFile(DisableFsRedir, DestFile, CurFile^.Attribs);
+  AddAttributesToFileRedir(DisableFsRedir, DestFile, CurFile^.Attribs);
 end;
 end;
 
 
 procedure ExtractTemporaryFile(const BaseName: String);
 procedure ExtractTemporaryFile(const BaseName: String);
@@ -3561,7 +3561,6 @@ end;
 
 
 function DownloadTemporaryFile(const Url, BaseName, RequiredSHA256OfFile: String; const OnDownloadProgress: TOnDownloadProgress): Int64;
 function DownloadTemporaryFile(const Url, BaseName, RequiredSHA256OfFile: String; const OnDownloadProgress: TOnDownloadProgress): Int64;
 var
 var
-  DisableFsRedir: Boolean;
   DestFile, TempFile: String;
   DestFile, TempFile: String;
   TempF: TFileRedir;
   TempF: TFileRedir;
   HandleStream: THandleStream;
   HandleStream: THandleStream;
@@ -3585,20 +3584,20 @@ begin
 
 
   LogFmt('Downloading temporary file from %s: %s', [MaskPasswordInURL(Url), DestFile]);
   LogFmt('Downloading temporary file from %s: %s', [MaskPasswordInURL(Url), DestFile]);
 
 
-  DisableFsRedir := InstallDefaultDisableFsRedir;
+  const DisableFsRedir = False; { Like everything else working on the temp dir }
 
 
   { Prepare directory }
   { Prepare directory }
   if FileExists(DestFile) then begin
   if FileExists(DestFile) then begin
     if (RequiredSHA256OfFile <> '') and
     if (RequiredSHA256OfFile <> '') and
-       (RequiredSHA256OfFile = SHA256DigestToString(GetSHA256OfFile(DisableFsRedir, DestFile))) then begin
+       (RequiredSHA256OfFile = SHA256DigestToString(GetSHA256OfFileRedir(DisableFsRedir, DestFile))) then begin
       Log('  File already downloaded.');
       Log('  File already downloaded.');
       Result := 0;
       Result := 0;
       Exit;
       Exit;
     end;
     end;
     SetFileAttributesRedir(DisableFsRedir, DestFile, GetFileAttributesRedir(DisableFsRedir, DestFile) and not FILE_ATTRIBUTE_READONLY);
     SetFileAttributesRedir(DisableFsRedir, DestFile, GetFileAttributesRedir(DisableFsRedir, DestFile) and not FILE_ATTRIBUTE_READONLY);
-    DelayDeleteFile(DisableFsRedir, DestFile, 13, 50, 250);
+    DelayDeleteFileRedir(DisableFsRedir, DestFile, 13, 50, 250);
   end else
   end else
-    ForceDirectories(DisableFsRedir, PathExtractPath(DestFile));
+    ForceDirectoriesRedir(DisableFsRedir, PathExtractPath(DestFile));
 
 
   HTTPDataReceiver := nil;
   HTTPDataReceiver := nil;
   HTTPClient := nil;
   HTTPClient := nil;
@@ -3621,7 +3620,7 @@ begin
     HTTPClient.OnReceiveData := HTTPDataReceiver.OnReceiveData;
     HTTPClient.OnReceiveData := HTTPDataReceiver.OnReceiveData;
 
 
     { Create temporary file }
     { Create temporary file }
-    TempFile := GenerateUniqueName(DisableFsRedir, PathExtractPath(DestFile), '.tmp');
+    TempFile := GenerateUniqueNameRedir(DisableFsRedir, PathExtractPath(DestFile), '.tmp');
     TempF := TFileRedir.Create(DisableFsRedir, TempFile, fdCreateAlways, faWrite, fsNone);
     TempF := TFileRedir.Create(DisableFsRedir, TempFile, fdCreateAlways, faWrite, fsNone);
     TempFileLeftOver := True;
     TempFileLeftOver := True;
 
 
@@ -3653,7 +3652,7 @@ begin
       { Check hash if specified, otherwise check everything else we can check }
       { Check hash if specified, otherwise check everything else we can check }
       if RequiredSHA256OfFile <> '' then begin
       if RequiredSHA256OfFile <> '' then begin
         try
         try
-          SHA256OfFile := SHA256DigestToString(GetSHA256OfFile(DisableFsRedir, TempFile));
+          SHA256OfFile := SHA256DigestToString(GetSHA256OfFileRedir(DisableFsRedir, TempFile));
         except on E: Exception do
         except on E: Exception do
           raise Exception.Create(FmtSetupMessage(msgErrorFileHash1, [E.Message]));
           raise Exception.Create(FmtSetupMessage(msgErrorFileHash1, [E.Message]));
         end;
         end;

+ 25 - 20
Projects/Src/Setup.MainFunc.pas

@@ -206,7 +206,7 @@ procedure NotifyAfterInstallFileEntry(const FileEntry: PSetupFileEntry);
 procedure NotifyBeforeInstallEntry(const BeforeInstall: String);
 procedure NotifyBeforeInstallEntry(const BeforeInstall: String);
 procedure NotifyBeforeInstallFileEntry(const FileEntry: PSetupFileEntry);
 procedure NotifyBeforeInstallFileEntry(const FileEntry: PSetupFileEntry);
 function PreviousInstallCompleted(const WizardComponents, WizardTasks: TStringList): Boolean;
 function PreviousInstallCompleted(const WizardComponents, WizardTasks: TStringList): Boolean;
-function CodeRegisterExtraCloseApplicationsResource(const DisableFsRedir: Boolean; const AFilename: String): Boolean;
+function CodeRegisterExtraCloseApplicationsResourceRedir(const DisableFsRedir: Boolean; const AFilename: String): Boolean;
 procedure RegisterResourcesWithRestartManager(const WizardComponents, WizardTasks: TStringList);
 procedure RegisterResourcesWithRestartManager(const WizardComponents, WizardTasks: TStringList);
 procedure RemoveTempInstallDir;
 procedure RemoveTempInstallDir;
 procedure SaveInf(const FileName: String);
 procedure SaveInf(const FileName: String);
@@ -1483,7 +1483,7 @@ begin
   if TempInstallDir <> '' then begin
   if TempInstallDir <> '' then begin
     if Debugging then
     if Debugging then
       DebugNotifyTempDir('');
       DebugNotifyTempDir('');
-    if not DelTree(False, TempInstallDir, True, True, True, False, nil,
+    if not DelTreeRedir(False, TempInstallDir, True, True, True, False, nil,
        TempDeleteFileProc, Pointer(GetTickCount())) then
        TempDeleteFileProc, Pointer(GetTickCount())) then
       Log('Failed to remove temporary directory: ' + TempInstallDir);
       Log('Failed to remove temporary directory: ' + TempInstallDir);
   end;
   end;
@@ -1742,7 +1742,7 @@ end;
 function EnumFiles(const EnumFilesProc: TEnumFilesProc;
 function EnumFiles(const EnumFilesProc: TEnumFilesProc;
   const WizardComponents, WizardTasks: TStringList; const Param: Pointer): Boolean;
   const WizardComponents, WizardTasks: TStringList; const Param: Pointer): Boolean;
 
 
-  function RecurseExternalFiles(const DisableFsRedir: Boolean;
+  function RecurseExternalFilesRedir(const DisableFsRedir: Boolean;
     const SearchBaseDir, SearchSubDir, SearchWildcard: String;
     const SearchBaseDir, SearchSubDir, SearchWildcard: String;
     const SourceIsWildcard: Boolean; const Excludes: TStringList; const CurFile: PSetupFileEntry): Boolean;
     const SourceIsWildcard: Boolean; const Excludes: TStringList; const CurFile: PSetupFileEntry): Boolean;
   var
   var
@@ -1789,7 +1789,7 @@ function EnumFiles(const EnumFilesProc: TEnumFilesProc;
         try
         try
           repeat
           repeat
             if IsRecurseableDirectory(FindData) then
             if IsRecurseableDirectory(FindData) then
-              if not RecurseExternalFiles(DisableFsRedir, SearchBaseDir,
+              if not RecurseExternalFilesRedir(DisableFsRedir, SearchBaseDir,
                  SearchSubDir + FindData.cFileName + '\', SearchWildcard,
                  SearchSubDir + FindData.cFileName + '\', SearchWildcard,
                  SourceIsWildcard, Excludes, CurFile) then begin
                  SourceIsWildcard, Excludes, CurFile) then begin
                 Result := False;
                 Result := False;
@@ -1833,7 +1833,7 @@ begin
           { External file }
           { External file }
           SourceWildcard := ExpandConst(CurFile^.SourceFilename);
           SourceWildcard := ExpandConst(CurFile^.SourceFilename);
           Excludes.DelimitedText := CurFile^.Excludes;
           Excludes.DelimitedText := CurFile^.Excludes;
-          if not RecurseExternalFiles(DisableFsRedir, PathExtractPath(SourceWildcard), '',
+          if not RecurseExternalFilesRedir(DisableFsRedir, PathExtractPath(SourceWildcard), '',
              PathExtractName(SourceWildcard), IsWildcard(SourceWildcard), Excludes, CurFile) then begin
              PathExtractName(SourceWildcard), IsWildcard(SourceWildcard), Excludes, CurFile) then begin
             Result := False;
             Result := False;
             Exit;
             Exit;
@@ -1851,13 +1851,13 @@ begin
         if ShouldProcessEntry(WizardComponents, WizardTasks, Components, Tasks, Languages, Check) then begin
         if ShouldProcessEntry(WizardComponents, WizardTasks, Components, Tasks, Languages, Check) then begin
           case DeleteType of
           case DeleteType of
             dfFiles, dfFilesAndOrSubdirs:
             dfFiles, dfFilesAndOrSubdirs:
-              if not DelTree(InstallDefaultDisableFsRedir, ExpandConst(Name), False, True, DeleteType = dfFilesAndOrSubdirs, True,
+              if not DelTreeRedir(InstallDefaultDisableFsRedir, ExpandConst(Name), False, True, DeleteType = dfFilesAndOrSubdirs, True,
                  DummyDeleteDirProc, EnumFilesProc, Param) then begin
                  DummyDeleteDirProc, EnumFilesProc, Param) then begin
                 Result := False;
                 Result := False;
                 Exit;
                 Exit;
               end;
               end;
             dfDirIfEmpty:
             dfDirIfEmpty:
-              if not DelTree(InstallDefaultDisableFsRedir, ExpandConst(Name), True, False, False, True,
+              if not DelTreeRedir(InstallDefaultDisableFsRedir, ExpandConst(Name), True, False, False, True,
                  DummyDeleteDirProc, EnumFilesProc, Param) then begin
                  DummyDeleteDirProc, EnumFilesProc, Param) then begin
                 Result := False;
                 Result := False;
                 Exit;
                 Exit;
@@ -1874,7 +1874,7 @@ end;
 var
 var
   CheckForFileSL: TStringList;
   CheckForFileSL: TStringList;
 
 
-function CheckForFile(const DisableFsRedir: Boolean; const AFilename: String;
+function CheckForFileProc(const DisableFsRedir: Boolean; const AFilename: String;
   const Param: Pointer): Boolean;
   const Param: Pointer): Boolean;
 var
 var
   Filename: String;
   Filename: String;
@@ -1905,7 +1905,7 @@ begin
     EnumFileReplaceOperationsFilenames(EnumProc, CheckForFileSL);
     EnumFileReplaceOperationsFilenames(EnumProc, CheckForFileSL);
     if CheckForFileSL.Count = 0 then
     if CheckForFileSL.Count = 0 then
       Exit;
       Exit;
-    Result := EnumFiles(CheckForFile, WizardComponents, WizardTasks, nil);
+    Result := EnumFiles(CheckForFileProc, WizardComponents, WizardTasks, nil);
   finally
   finally
     CheckForFileSL.Free;
     CheckForFileSL.Free;
   end;
   end;
@@ -1919,18 +1919,17 @@ var
   RegisterFileBatchFilenames: PArrayOfPWideChar;
   RegisterFileBatchFilenames: PArrayOfPWideChar;
   RegisterFileFilenamesBatchMax, RegisterFileFilenamesBatchCount: Integer;
   RegisterFileFilenamesBatchMax, RegisterFileFilenamesBatchCount: Integer;
 
 
-function RegisterFile(const DisableFsRedir: Boolean; const AFilename: String;
-  const Param: Pointer): Boolean;
+function RegisterFileRedir(const DisableFsRedir: Boolean; const AFilename: String;
+  const CheckFilter: Boolean): Boolean;
 var
 var
   Filename, Text: String;
   Filename, Text: String;
   I, Len: Integer;
   I, Len: Integer;
-  CheckFilter, Match: Boolean;
+  Match: Boolean;
 begin
 begin
   Filename := AFilename;
   Filename := AFilename;
 
 
   { First: check filters and self. }
   { First: check filters and self. }
   if Filename <> '' then begin
   if Filename <> '' then begin
-    CheckFilter := Boolean(Param);
     if CheckFilter then begin
     if CheckFilter then begin
       Match := False;
       Match := False;
       Text := PathLowercase(PathExtractName(Filename));
       Text := PathLowercase(PathExtractName(Filename));
@@ -1999,14 +1998,20 @@ begin
   Result := RmSessionStarted; { Break the enum if there was an error, else continue. }
   Result := RmSessionStarted; { Break the enum if there was an error, else continue. }
 end;
 end;
 
 
+function RegisterFileProc(const DisableFsRedir: Boolean; const AFilename: String;
+  const Param: Pointer): Boolean;
+begin
+  Result := RegisterFileRedir(DisableFsRedir, AFilename, Boolean(Param));
+end;
+
 { Helper function for [Code] to register extra files. }
 { Helper function for [Code] to register extra files. }
 var
 var
   AllowCodeRegisterExtraCloseApplicationsResource: Boolean;
   AllowCodeRegisterExtraCloseApplicationsResource: Boolean;
 
 
-function CodeRegisterExtraCloseApplicationsResource(const DisableFsRedir: Boolean; const AFilename: String): Boolean;
+function CodeRegisterExtraCloseApplicationsResourceRedir(const DisableFsRedir: Boolean; const AFilename: String): Boolean;
 begin
 begin
   if AllowCodeRegisterExtraCloseApplicationsResource then
   if AllowCodeRegisterExtraCloseApplicationsResource then
-    Result := RegisterFile(DisableFsRedir, AFilename, Pointer(False))
+    Result := RegisterFileRedir(DisableFsRedir, AFilename, False)
   else begin
   else begin
     InternalError('Cannot call "RegisterExtraCloseApplicationsResource" function at this time');
     InternalError('Cannot call "RegisterExtraCloseApplicationsResource" function at this time');
     Result := False;
     Result := False;
@@ -2025,7 +2030,7 @@ begin
   try
   try
     { Register our files. }
     { Register our files. }
     RmRegisteredFilesCount := 0;
     RmRegisteredFilesCount := 0;
-    EnumFiles(RegisterFile, WizardComponents, WizardTasks, Pointer(True));
+    EnumFiles(RegisterFileProc, WizardComponents, WizardTasks, Pointer(True));
     { Ask [Code] for more files. }
     { Ask [Code] for more files. }
     if CodeRunner <> nil then begin
     if CodeRunner <> nil then begin
       AllowCodeRegisterExtraCloseApplicationsResource := True;
       AllowCodeRegisterExtraCloseApplicationsResource := True;
@@ -2042,7 +2047,7 @@ begin
     end;
     end;
     { Don't forget to register leftovers. }
     { Don't forget to register leftovers. }
     if RmSessionStarted then
     if RmSessionStarted then
-      RegisterFile(False, '', nil);
+      RegisterFileRedir(False, '', False);
   finally
   finally
     for I := 0 to RegisterFileFilenamesBatchCount-1 do
     for I := 0 to RegisterFileFilenamesBatchCount-1 do
       FreeMem(RegisterFileBatchFilenames[I]);
       FreeMem(RegisterFileBatchFilenames[I]);
@@ -2686,7 +2691,7 @@ var
       InstallMode := imSilent;
       InstallMode := imSilent;
   end;
   end;
 
 
-  function RecurseExternalGetSizeOfFiles(const DisableFsRedir: Boolean;
+  function RecurseExternalGetSizeOfFilesRedir(const DisableFsRedir: Boolean;
     const SearchBaseDir, SearchSubDir, SearchWildcard: String;
     const SearchBaseDir, SearchSubDir, SearchWildcard: String;
     const SourceIsWildcard: Boolean; const RecurseSubDirs: Boolean): Integer64;
     const SourceIsWildcard: Boolean; const RecurseSubDirs: Boolean): Integer64;
   var
   var
@@ -2722,7 +2727,7 @@ var
         try
         try
           repeat
           repeat
             if IsRecurseableDirectory(FindData) then begin
             if IsRecurseableDirectory(FindData) then begin
-              I := RecurseExternalGetSizeOfFiles(DisableFsRedir, SearchBaseDir,
+              I := RecurseExternalGetSizeOfFilesRedir(DisableFsRedir, SearchBaseDir,
                 SearchSubDir + FindData.cFileName + '\', SearchWildcard,
                 SearchSubDir + FindData.cFileName + '\', SearchWildcard,
                 SourceIsWildcard, RecurseSubDirs);
                 SourceIsWildcard, RecurseSubDirs);
               Inc6464(Result, I);
               Inc6464(Result, I);
@@ -3385,7 +3390,7 @@ begin
               SourceWildcard := NewParamStr(0)
               SourceWildcard := NewParamStr(0)
             else
             else
               SourceWildcard := ExpandConst(SourceFilename);
               SourceWildcard := ExpandConst(SourceFilename);
-            ExternalSize := RecurseExternalGetSizeOfFiles(
+            ExternalSize := RecurseExternalGetSizeOfFilesRedir(
               ShouldDisableFsRedirForFileEntry(PSetupFileEntry(Entries[seFile][I])),
               ShouldDisableFsRedirForFileEntry(PSetupFileEntry(Entries[seFile][I])),
               PathExtractPath(SourceWildcard),
               PathExtractPath(SourceWildcard),
               '', PathExtractName(SourceWildcard), IsWildcard(SourceWildcard),
               '', PathExtractName(SourceWildcard), IsWildcard(SourceWildcard),

+ 3 - 3
Projects/Src/Setup.RegSvr.pas

@@ -2,7 +2,7 @@ unit Setup.RegSvr;
 
 
 {
 {
   Inno Setup
   Inno Setup
-  Copyright (C) 1997-2024 Jordan Russell
+  Copyright (C) 1997-2025 Jordan Russell
   Portions by Martijn Laan
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
   For conditions of distribution and use, see LICENSE.TXT.
 
 
@@ -98,9 +98,9 @@ begin
   DeleteOldTempFiles(PathExtractPath(SelfFilename));
   DeleteOldTempFiles(PathExtractPath(SelfFilename));
   NewFilename := RenameToNonRandomTempName(SelfFilename);
   NewFilename := RenameToNonRandomTempName(SelfFilename);
   if NewFilename <> '' then
   if NewFilename <> '' then
-    RestartReplace(False, NewFilename, '')
+    RestartReplaceRedir(False, NewFilename, '')
   else
   else
-    RestartReplace(False, SelfFilename, '');
+    RestartReplaceRedir(False, SelfFilename, '');
 end;
 end;
 
 
 procedure RunRegSvr;
 procedure RunRegSvr;

+ 7 - 7
Projects/Src/Setup.ScriptFunc.HelperFunc.pas

@@ -2,7 +2,7 @@ unit Setup.ScriptFunc.HelperFunc;
 
 
 {
 {
   Inno Setup
   Inno Setup
-  Copyright (C) 1997-2024 Jordan Russell
+  Copyright (C) 1997-2025 Jordan Russell
   Portions by Martijn Laan
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
   For conditions of distribution and use, see LICENSE.TXT.
 
 
@@ -65,8 +65,8 @@ procedure CrackCodeRootKey(CodeRootKey: HKEY; var RegView: TRegView;
   var RootKey: HKEY);
   var RootKey: HKEY);
 function GetSubkeyOrValueNames(const RegView: TRegView; const RootKey: HKEY;
 function GetSubkeyOrValueNames(const RegView: TRegView; const RootKey: HKEY;
   const SubKeyName: String; const Stack: TPSStack; const ItemNo: Longint; const Subkey: Boolean): Boolean;
   const SubKeyName: String; const Stack: TPSStack; const ItemNo: Longint; const Subkey: Boolean): Boolean;
-function GetMD5OfFile(const DisableFsRedir: Boolean; const Filename: String): TMD5Digest;
-function GetSHA1OfFile(const DisableFsRedir: Boolean; const Filename: String): TSHA1Digest;
+function GetMD5OfFileRedir(const DisableFsRedir: Boolean; const Filename: String): TMD5Digest;
+function GetSHA1OfFileRedir(const DisableFsRedir: Boolean; const Filename: String): TSHA1Digest;
 function GetMD5OfAnsiString(const S: AnsiString): TMD5Digest;
 function GetMD5OfAnsiString(const S: AnsiString): TMD5Digest;
 function GetMD5OfUnicodeString(const S: UnicodeString): TMD5Digest;
 function GetMD5OfUnicodeString(const S: UnicodeString): TMD5Digest;
 function GetSHA1OfAnsiString(const S: AnsiString): TSHA1Digest;
 function GetSHA1OfAnsiString(const S: AnsiString): TSHA1Digest;
@@ -76,7 +76,7 @@ procedure ExecAndLogOutputLog(const S: String; const Error, FirstLine: Boolean;
 procedure ExecAndLogOutputLogCustom(const S: String; const Error, FirstLine: Boolean; const Data: NativeInt);
 procedure ExecAndLogOutputLogCustom(const S: String; const Error, FirstLine: Boolean; const Data: NativeInt);
 function CustomMessage(const MsgName: String): String;
 function CustomMessage(const MsgName: String): String;
 function NewExtractRelativePath(BaseName, DestName: string): string;
 function NewExtractRelativePath(BaseName, DestName: string): string;
-function NewFileSearch(const DisableFsRedir: Boolean;
+function NewFileSearchRedir(const DisableFsRedir: Boolean;
   const Name, DirList: String): String;
   const Name, DirList: String): String;
 function GetExceptionMessage(const Caller: TPSExec): String;
 function GetExceptionMessage(const Caller: TPSExec): String;
 function GetCodePreviousData(const ExpandedAppID, ValueName, DefaultValueData: String): String;
 function GetCodePreviousData(const ExpandedAppID, ValueName, DefaultValueData: String): String;
@@ -301,7 +301,7 @@ begin
   Result := True;
   Result := True;
 end;
 end;
 
 
-function GetMD5OfFile(const DisableFsRedir: Boolean; const Filename: String): TMD5Digest;
+function GetMD5OfFileRedir(const DisableFsRedir: Boolean; const Filename: String): TMD5Digest;
 { Gets MD5 sum of the file Filename. An exception will be raised upon
 { Gets MD5 sum of the file Filename. An exception will be raised upon
   failure. }
   failure. }
 var
 var
@@ -323,7 +323,7 @@ begin
   Result := MD5Final(Context);
   Result := MD5Final(Context);
 end;
 end;
 
 
-function GetSHA1OfFile(const DisableFsRedir: Boolean; const Filename: String): TSHA1Digest;
+function GetSHA1OfFileRedir(const DisableFsRedir: Boolean; const Filename: String): TSHA1Digest;
 { Gets SHA-1 sum of the file Filename. An exception will be raised upon
 { Gets SHA-1 sum of the file Filename. An exception will be raised upon
   failure. }
   failure. }
 var
 var
@@ -455,7 +455,7 @@ end;
   - it uses NewFileExistsRedir instead of FileExists
   - it uses NewFileExistsRedir instead of FileExists
   - it doesn't search the current directory unless it's told to
   - it doesn't search the current directory unless it's told to
   - it always returns a fully-qualified path }
   - it always returns a fully-qualified path }
-function NewFileSearch(const DisableFsRedir: Boolean;
+function NewFileSearchRedir(const DisableFsRedir: Boolean;
   const Name, DirList: String): String;
   const Name, DirList: String): String;
 var
 var
   I, P, L: Integer;
   I, P, L: Integer;

+ 13 - 13
Projects/Src/Setup.ScriptFunc.pas

@@ -838,15 +838,15 @@ var
     end);
     end);
     RegisterScriptFunc('DELAYDELETEFILE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('DELAYDELETEFILE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
-      DelayDeleteFile(ScriptFuncDisableFsRedir, Stack.GetString(PStart), Stack.GetInt(PStart-1), 250, 250);
+      DelayDeleteFileRedir(ScriptFuncDisableFsRedir, Stack.GetString(PStart), Stack.GetInt(PStart-1), 250, 250);
     end);
     end);
     RegisterScriptFunc('DELTREE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('DELTREE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
-      Stack.SetBool(PStart, DelTree(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1), Stack.GetBool(PStart-2), Stack.GetBool(PStart-3), Stack.GetBool(PStart-4), False, nil, nil, nil));
+      Stack.SetBool(PStart, DelTreeRedir(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1), Stack.GetBool(PStart-2), Stack.GetBool(PStart-3), Stack.GetBool(PStart-4), False, nil, nil, nil));
     end);
     end);
     RegisterScriptFunc('GENERATEUNIQUENAME', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('GENERATEUNIQUENAME', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
-      Stack.SetString(PStart, GenerateUniqueName(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1), Stack.GetString(PStart-2)));
+      Stack.SetString(PStart, GenerateUniqueNameRedir(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1), Stack.GetString(PStart-2)));
     end);
     end);
     RegisterScriptFunc('GETCOMPUTERNAMESTRING', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('GETCOMPUTERNAMESTRING', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
@@ -854,7 +854,7 @@ var
     end);
     end);
     RegisterScriptFunc('GETMD5OFFILE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('GETMD5OFFILE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
-      Stack.SetString(PStart, MD5DigestToString(GetMD5OfFile(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1))));
+      Stack.SetString(PStart, MD5DigestToString(GetMD5OfFileRedir(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1))));
     end);
     end);
     RegisterScriptFunc('GETMD5OFSTRING', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('GETMD5OFSTRING', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
@@ -866,7 +866,7 @@ var
     end);
     end);
     RegisterScriptFunc('GETSHA1OFFILE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('GETSHA1OFFILE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
-      Stack.SetString(PStart, SHA1DigestToString(GetSHA1OfFile(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1))));
+      Stack.SetString(PStart, SHA1DigestToString(GetSHA1OfFileRedir(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1))));
     end);
     end);
     RegisterScriptFunc('GETSHA1OFSTRING', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('GETSHA1OFSTRING', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
@@ -878,7 +878,7 @@ var
     end);
     end);
     RegisterScriptFunc('GETSHA256OFFILE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('GETSHA256OFFILE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
-      Stack.SetString(PStart, SHA256DigestToString(GetSHA256OfFile(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1))));
+      Stack.SetString(PStart, SHA256DigestToString(GetSHA256OfFileRedir(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1))));
     end);
     end);
     RegisterScriptFunc('GETSHA256OFSTREAM', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('GETSHA256OFSTREAM', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
@@ -895,7 +895,7 @@ var
     RegisterScriptFunc('GETSPACEONDISK', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('GETSPACEONDISK', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
       var FreeBytes, TotalBytes: Integer64;
       var FreeBytes, TotalBytes: Integer64;
-      if GetSpaceOnDisk(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1), FreeBytes, TotalBytes) then begin
+      if GetSpaceOnDiskRedir(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1), FreeBytes, TotalBytes) then begin
         if Stack.GetBool(PStart-2) then begin
         if Stack.GetBool(PStart-2) then begin
           Div64(FreeBytes, 1024*1024);
           Div64(FreeBytes, 1024*1024);
           Div64(TotalBytes, 1024*1024);
           Div64(TotalBytes, 1024*1024);
@@ -914,7 +914,7 @@ var
     RegisterScriptFunc('GETSPACEONDISK64', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('GETSPACEONDISK64', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
       var FreeBytes, TotalBytes: Integer64;
       var FreeBytes, TotalBytes: Integer64;
-      if GetSpaceOnDisk(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1), FreeBytes, TotalBytes) then begin
+      if GetSpaceOnDiskRedir(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1), FreeBytes, TotalBytes) then begin
         Stack.SetInt64(PStart-2, Int64(FreeBytes.Hi) shl 32 + FreeBytes.Lo);
         Stack.SetInt64(PStart-2, Int64(FreeBytes.Hi) shl 32 + FreeBytes.Lo);
         Stack.SetInt64(PStart-3, Int64(TotalBytes.Hi) shl 32 + TotalBytes.Lo);
         Stack.SetInt64(PStart-3, Int64(TotalBytes.Hi) shl 32 + TotalBytes.Lo);
         Stack.SetBool(PStart, True);
         Stack.SetBool(PStart, True);
@@ -1011,7 +1011,7 @@ var
     end);
     end);
     RegisterScriptFunc('ISPROTECTEDSYSTEMFILE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('ISPROTECTEDSYSTEMFILE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
-      Stack.SetBool(PStart, IsProtectedSystemFile(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1)));
+      Stack.SetBool(PStart, IsProtectedSystemFileRedir(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1)));
     end);
     end);
     RegisterScriptFunc('MAKEPENDINGFILERENAMEOPERATIONSCHECKSUM', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('MAKEPENDINGFILERENAMEOPERATIONSCHECKSUM', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
@@ -1040,11 +1040,11 @@ var
     end);
     end);
     RegisterScriptFunc('RESTARTREPLACE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('RESTARTREPLACE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
-      RestartReplace(ScriptFuncDisableFsRedir, Stack.GetString(PStart), Stack.GetString(PStart-1));
+      RestartReplaceRedir(ScriptFuncDisableFsRedir, Stack.GetString(PStart), Stack.GetString(PStart-1));
     end);
     end);
     RegisterScriptFunc('FORCEDIRECTORIES', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('FORCEDIRECTORIES', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
-      Stack.SetBool(PStart, ForceDirectories(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1)));
+      Stack.SetBool(PStart, ForceDirectoriesRedir(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1)));
     end);
     end);
   end;
   end;
 
 
@@ -1178,7 +1178,7 @@ var
     end);
     end);
     RegisterScriptFunc('REGISTEREXTRACLOSEAPPLICATIONSRESOURCE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('REGISTEREXTRACLOSEAPPLICATIONSRESOURCE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
-      Stack.SetBool(PStart, CodeRegisterExtraCloseApplicationsResource(Stack.GetBool(PStart-1), Stack.GetString(PStart-2)));
+      Stack.SetBool(PStart, CodeRegisterExtraCloseApplicationsResourceRedir(Stack.GetBool(PStart-1), Stack.GetString(PStart-2)));
     end);
     end);
     RegisterScriptFunc('GETWIZARDFORM', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('GETWIZARDFORM', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
@@ -1326,7 +1326,7 @@ var
     end);
     end);
     RegisterScriptFunc('FILESEARCH', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('FILESEARCH', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin
-      Stack.SetString(PStart, NewFileSearch(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1), Stack.GetString(PStart-2)));
+      Stack.SetString(PStart, NewFileSearchRedir(ScriptFuncDisableFsRedir, Stack.GetString(PStart-1), Stack.GetString(PStart-2)));
     end);
     end);
     RegisterScriptFunc('RENAMEFILE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     RegisterScriptFunc('RENAMEFILE', procedure(const Caller: TPSExec; const OrgName: AnsiString; const Stack: TPSStack; const PStart: Cardinal)
     begin
     begin

+ 3 - 3
Projects/Src/Setup.SecurityFunc.pas

@@ -2,7 +2,7 @@ unit Setup.SecurityFunc;
 
 
 {
 {
   Inno Setup
   Inno Setup
-  Copyright (C) 1997-2024 Jordan Russell
+  Copyright (C) 1997-2025 Jordan Russell
   Portions by Martijn Laan
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
   For conditions of distribution and use, see LICENSE.TXT.
 
 
@@ -14,7 +14,7 @@ interface
 uses
 uses
   Windows, SysUtils, Shared.CommonFunc, Shared.Struct;
   Windows, SysUtils, Shared.CommonFunc, Shared.Struct;
 
 
-function GrantPermissionOnFile(const DisableFsRedir: Boolean; Filename: String;
+function GrantPermissionOnFileRedir(const DisableFsRedir: Boolean; Filename: String;
   const Entries: TGrantPermissionEntry; const EntryCount: Integer): Boolean;
   const Entries: TGrantPermissionEntry; const EntryCount: Integer): Boolean;
 function GrantPermissionOnKey(const RegView: TRegView; const RootKey: HKEY;
 function GrantPermissionOnKey(const RegView: TRegView; const RootKey: HKEY;
   const Subkey: String; const Entries: TGrantPermissionEntry;
   const Subkey: String; const Entries: TGrantPermissionEntry;
@@ -157,7 +157,7 @@ const
   OBJECT_INHERIT_ACE    = 1;
   OBJECT_INHERIT_ACE    = 1;
   CONTAINER_INHERIT_ACE = 2;
   CONTAINER_INHERIT_ACE = 2;
 
 
-function GrantPermissionOnFile(const DisableFsRedir: Boolean; Filename: String;
+function GrantPermissionOnFileRedir(const DisableFsRedir: Boolean; Filename: String;
   const Entries: TGrantPermissionEntry; const EntryCount: Integer): Boolean;
   const Entries: TGrantPermissionEntry; const EntryCount: Integer): Boolean;
 { Grants the specified access to the specified file/directory. Returns True if
 { Grants the specified access to the specified file/directory. Returns True if
   successful. On failure, the thread's last error code is set. }
   successful. On failure, the thread's last error code is set. }

+ 2 - 2
Projects/Src/Setup.SpawnClient.pas

@@ -2,7 +2,7 @@ unit Setup.SpawnClient;
 
 
 {
 {
   Inno Setup
   Inno Setup
-  Copyright (C) 1997-2024 Jordan Russell
+  Copyright (C) 1997-2025 Jordan Russell
   Portions by Martijn Laan
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
   For conditions of distribution and use, see LICENSE.TXT.
 
 
@@ -144,7 +144,7 @@ var
   M: TMemoryStream;
   M: TMemoryStream;
 begin
 begin
   if not RunAsOriginalUser or not SpawnServerPresent then begin
   if not RunAsOriginalUser or not SpawnServerPresent then begin
-    Result := InstExec(DisableFsRedir, Filename, Params, WorkingDir,
+    Result := InstExecRedir(DisableFsRedir, Filename, Params, WorkingDir,
       Wait, ShowCmd, ProcessMessagesProc, OutputReader, ResultCode);
       Wait, ShowCmd, ProcessMessagesProc, OutputReader, ResultCode);
     Exit;
     Exit;
   end;
   end;

+ 2 - 2
Projects/Src/Setup.SpawnServer.pas

@@ -2,7 +2,7 @@ unit Setup.SpawnServer;
 
 
 {
 {
   Inno Setup
   Inno Setup
-  Copyright (C) 1997-2024 Jordan Russell
+  Copyright (C) 1997-2025 Jordan Russell
   Portions by Martijn Laan
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
   For conditions of distribution and use, see LICENSE.TXT.
 
 
@@ -379,7 +379,7 @@ begin
           TExecWait(EWait), EShowCmd, ProcessMessagesProc, FResultCode);
           TExecWait(EWait), EShowCmd, ProcessMessagesProc, FResultCode);
       end
       end
       else begin
       else begin
-        ExecResult := InstExec(EDisableFsRedir <> 0, EFilename, EParams, EWorkingDir,
+        ExecResult := InstExecRedir(EDisableFsRedir <> 0, EFilename, EParams, EWorkingDir,
           TExecWait(EWait), EShowCmd, ProcessMessagesProc, nil, FResultCode);
           TExecWait(EWait), EShowCmd, ProcessMessagesProc, nil, FResultCode);
       end;
       end;
       if ExecResult then
       if ExecResult then

+ 3 - 3
Projects/Src/Setup.Uninstall.pas

@@ -237,7 +237,7 @@ begin
       Sleep(500);
       Sleep(500);
   end;
   end;
   UninstallExitCode := 0;
   UninstallExitCode := 0;
-  DelayDeleteFile(False, UninstExeFilename, 13, 50, 250);
+  DelayDeleteFileRedir(False, UninstExeFilename, 13, 50, 250);
   if Debugging then
   if Debugging then
     DebugNotifyUninstExe('');
     DebugNotifyUninstExe('');
   { Pre-Windows 2000 Add/Remove Programs will try to bring itself to the
   { Pre-Windows 2000 Add/Remove Programs will try to bring itself to the
@@ -371,8 +371,8 @@ begin
   TempFile := AddBackslash(TempDir) + '_unins.tmp';
   TempFile := AddBackslash(TempDir) + '_unins.tmp';
   if not TempDirExisted then
   if not TempDirExisted then
     try
     try
-      RestartReplace(False, TempFile, '');
-      RestartReplace(False, TempDir, '');
+      RestartReplaceRedir(False, TempFile, '');
+      RestartReplaceRedir(False, TempDir, '');
     except
     except
       { ignore exceptions }
       { ignore exceptions }
     end;
     end;

+ 10 - 10
Projects/Src/Setup.UninstallLog.pas

@@ -2,7 +2,7 @@ unit Setup.UninstallLog;
 
 
 {
 {
   Inno Setup
   Inno Setup
-  Copyright (C) 1997-2024 Jordan Russell
+  Copyright (C) 1997-2025 Jordan Russell
   Portions by Martijn Laan
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
   For conditions of distribution and use, see LICENSE.TXT.
 
 
@@ -245,7 +245,7 @@ begin
   Result := False;
   Result := False;
 end;
 end;
 
 
-procedure LoggedRestartDeleteDir(const DisableFsRedir: Boolean; Dir: String);
+procedure LoggedRestartDeleteDirRedir(const DisableFsRedir: Boolean; Dir: String);
 begin
 begin
   Dir := PathExpand(Dir);
   Dir := PathExpand(Dir);
   if not DisableFsRedir then begin
   if not DisableFsRedir then begin
@@ -262,7 +262,7 @@ const
   drFalse = '0';
   drFalse = '0';
   drTrue = '1';
   drTrue = '1';
 
 
-function LoggedDeleteDir(const DisableFsRedir: Boolean; const DirName: String;
+function LoggedDeleteDirRedir(const DisableFsRedir: Boolean; const DirName: String;
   const DirsNotRemoved, RestartDeleteDirList: TSimpleStringList): Boolean;
   const DirsNotRemoved, RestartDeleteDirList: TSimpleStringList): Boolean;
 const
 const
   FILE_ATTRIBUTE_REPARSE_POINT = $00000400;
   FILE_ATTRIBUTE_REPARSE_POINT = $00000400;
@@ -278,7 +278,7 @@ begin
     { If the directory has the read-only attribute, strip it first }
     { If the directory has the read-only attribute, strip it first }
     if Attribs and FILE_ATTRIBUTE_READONLY <> 0 then begin
     if Attribs and FILE_ATTRIBUTE_READONLY <> 0 then begin
       if (Attribs and FILE_ATTRIBUTE_REPARSE_POINT <> 0) or
       if (Attribs and FILE_ATTRIBUTE_REPARSE_POINT <> 0) or
-         IsDirEmpty(DisableFsRedir, DirName) then begin
+         IsDirEmptyRedir(DisableFsRedir, DirName) then begin
         if SetFileAttributesRedir(DisableFsRedir, DirName, Attribs and not FILE_ATTRIBUTE_READONLY) then
         if SetFileAttributesRedir(DisableFsRedir, DirName, Attribs and not FILE_ATTRIBUTE_READONLY) then
           Log('Stripped read-only attribute.')
           Log('Stripped read-only attribute.')
         else
         else
@@ -299,7 +299,7 @@ begin
          ListContainsPathOrSubdir(RestartDeleteDirList, DirName) then begin
          ListContainsPathOrSubdir(RestartDeleteDirList, DirName) then begin
         LogFmt('Failed to delete directory (%d). Will delete on restart (if empty).',
         LogFmt('Failed to delete directory (%d). Will delete on restart (if empty).',
           [LastError]);
           [LastError]);
-        LoggedRestartDeleteDir(DisableFsRedir, DirName);
+        LoggedRestartDeleteDirRedir(DisableFsRedir, DirName);
       end
       end
       else
       else
         LogFmt('Failed to delete directory (%d).', [LastError]);
         LogFmt('Failed to delete directory (%d).', [LastError]);
@@ -452,7 +452,7 @@ type
 function LoggedDeleteDirProc(const DisableFsRedir: Boolean; const DirName: String;
 function LoggedDeleteDirProc(const DisableFsRedir: Boolean; const DirName: String;
   const Param: Pointer): Boolean;
   const Param: Pointer): Boolean;
 begin
 begin
-  Result := LoggedDeleteDir(DisableFsRedir, DirName, PDeleteDirData(Param)^.DirsNotRemoved, nil);
+  Result := LoggedDeleteDirRedir(DisableFsRedir, DirName, PDeleteDirData(Param)^.DirsNotRemoved, nil);
 end;
 end;
 
 
 function LoggedDeleteFileProc(const DisableFsRedir: Boolean; const FileName: String;
 function LoggedDeleteFileProc(const DisableFsRedir: Boolean; const FileName: String;
@@ -608,7 +608,7 @@ var
           LogFmt('The file appears to be in use (%d). Will delete on restart.',
           LogFmt('The file appears to be in use (%d). Will delete on restart.',
             [LastError]);
             [LastError]);
           try
           try
-            RestartReplace(DisableFsRedir, Filename, '');
+            RestartReplaceRedir(DisableFsRedir, Filename, '');
             NeedRestart := True;
             NeedRestart := True;
             { Add the file's directory to the list of directories that should
             { Add the file's directory to the list of directories that should
               be restart-deleted later }
               be restart-deleted later }
@@ -715,7 +715,7 @@ var
         (e.g. '0C:\Program Files\My Program') }
         (e.g. '0C:\Program Files\My Program') }
       DisableFsRedir := (S[1] = drTrue);
       DisableFsRedir := (S[1] = drTrue);
       System.Delete(S, 1, 1);
       System.Delete(S, 1, 1);
-      LoggedDeleteDir(DisableFsRedir, S, nil, RestartDeleteDirList[DisableFsRedir]);
+      LoggedDeleteDirRedir(DisableFsRedir, S, nil, RestartDeleteDirList[DisableFsRedir]);
     end;
     end;
   end;
   end;
   
   
@@ -817,7 +817,7 @@ begin
                   try
                   try
                     if GetLogActive and (CurRec^.ExtraData and utRun_LogOutput <> 0) then
                     if GetLogActive and (CurRec^.ExtraData and utRun_LogOutput <> 0) then
                       OutputReader := TCreateProcessOutputReader.Create(RunExecLog, 0);
                       OutputReader := TCreateProcessOutputReader.Create(RunExecLog, 0);
-                    if not InstExec(CurRec^.ExtraData and utRun_DisableFsRedir <> 0,
+                    if not InstExecRedir(CurRec^.ExtraData and utRun_DisableFsRedir <> 0,
                        CurRecData[0], CurRecData[1], CurRecData[2], Wait,
                        CurRecData[0], CurRecData[1], CurRecData[2], Wait,
                        ShowCmd, ProcessMessagesProc, OutputReader, ErrorCode) then begin
                        ShowCmd, ProcessMessagesProc, OutputReader, ErrorCode) then begin
                       LogFmt('CreateProcess failed (%d).', [ErrorCode]);
                       LogFmt('CreateProcess failed (%d).', [ErrorCode]);
@@ -964,7 +964,7 @@ begin
             end;
             end;
           utDeleteDirOrFiles:
           utDeleteDirOrFiles:
             if (CallFromUninstaller or (CurRec^.ExtraData and utDeleteDirOrFiles_Extra = 0)) then begin
             if (CallFromUninstaller or (CurRec^.ExtraData and utDeleteDirOrFiles_Extra = 0)) then begin
-              if DelTree(CurRec^.ExtraData and utDeleteDirOrFiles_DisableFsRedir <> 0,
+              if DelTreeRedir(CurRec^.ExtraData and utDeleteDirOrFiles_DisableFsRedir <> 0,
                  CurRecData[0], CurRec^.ExtraData and utDeleteDirOrFiles_IsDir <> 0,
                  CurRecData[0], CurRec^.ExtraData and utDeleteDirOrFiles_IsDir <> 0,
                  CurRec^.ExtraData and utDeleteDirOrFiles_DeleteFiles <> 0,
                  CurRec^.ExtraData and utDeleteDirOrFiles_DeleteFiles <> 0,
                  CurRec^.ExtraData and utDeleteDirOrFiles_DeleteSubdirsAlso <> 0,
                  CurRec^.ExtraData and utDeleteDirOrFiles_DeleteSubdirsAlso <> 0,

+ 3 - 3
Projects/Src/Setup.WizardForm.pas

@@ -2,7 +2,7 @@ unit Setup.WizardForm;
 
 
 {
 {
   Inno Setup
   Inno Setup
-  Copyright (C) 1997-2024 Jordan Russell
+  Copyright (C) 1997-2025 Jordan Russell
   Portions by Martijn Laan
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
   For conditions of distribution and use, see LICENSE.TXT.
 
 
@@ -2374,7 +2374,7 @@ procedure TWizardForm.NextButtonClick(Sender: TObject);
 
 
     if InstallMode = imNormal then begin
     if InstallMode = imNormal then begin
       { Check if there's enough free disk space }
       { Check if there's enough free disk space }
-      if GetSpaceOnNearestMountPoint(False, T, FreeSpace, TotalSpace) then begin
+      if GetSpaceOnNearestMountPointRedir(False, T, FreeSpace, TotalSpace) then begin
         if Compare64(FreeSpace, MinimumSpace) < 0 then
         if Compare64(FreeSpace, MinimumSpace) < 0 then
           { If not, show warning }
           { If not, show warning }
           if LoggedMsgBox(FmtSetupMessage(msgDiskSpaceWarning,
           if LoggedMsgBox(FmtSetupMessage(msgDiskSpaceWarning,
@@ -2414,7 +2414,7 @@ procedure TWizardForm.NextButtonClick(Sender: TObject);
     Result := False;
     Result := False;
 
 
     if InstallMode = imNormal then begin
     if InstallMode = imNormal then begin
-      if GetSpaceOnNearestMountPoint(False, DirEdit.Text, FreeSpace, TotalSpace) then begin
+      if GetSpaceOnNearestMountPointRedir(False, DirEdit.Text, FreeSpace, TotalSpace) then begin
         if Compare64(FreeSpace, CurrentComponentsSpace) < 0 then
         if Compare64(FreeSpace, CurrentComponentsSpace) < 0 then
           if LoggedMsgBox(FmtSetupMessage(msgDiskSpaceWarning,
           if LoggedMsgBox(FmtSetupMessage(msgDiskSpaceWarning,
                [IntToKBStr(CurrentComponentsSpace), IntToKBStr(FreeSpace)]),
                [IntToKBStr(CurrentComponentsSpace), IntToKBStr(FreeSpace)]),

+ 6 - 6
Projects/Src/SetupLdrAndSetup.InstFunc.pas

@@ -2,7 +2,7 @@ unit SetupLdrAndSetup.InstFunc;
 
 
 {
 {
   Inno Setup
   Inno Setup
-  Copyright (C) 1997-2024 Jordan Russell
+  Copyright (C) 1997-2025 Jordan Russell
   Portions by Martijn Laan
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
   For conditions of distribution and use, see LICENSE.TXT.
 
 
@@ -21,7 +21,7 @@ type
 function CreateTempDir(const LimitCurrentUserSidAccess: Boolean;
 function CreateTempDir(const LimitCurrentUserSidAccess: Boolean;
   var Protected: Boolean): String; overload;
   var Protected: Boolean): String; overload;
 function CreateTempDir(const LimitCurrentUserSidAccess: Boolean): String; overload;
 function CreateTempDir(const LimitCurrentUserSidAccess: Boolean): String; overload;
-procedure DelayDeleteFile(const DisableFsRedir: Boolean; const Filename: String;
+procedure DelayDeleteFileRedir(const DisableFsRedir: Boolean; const Filename: String;
   const MaxTries, FirstRetryDelayMS, SubsequentRetryDelayMS: Integer);
   const MaxTries, FirstRetryDelayMS, SubsequentRetryDelayMS: Integer);
 function DetermineDefaultLanguage(const GetLanguageEntryProc: TGetLanguageEntryProc;
 function DetermineDefaultLanguage(const GetLanguageEntryProc: TGetLanguageEntryProc;
   const Method: TSetupLanguageDetectionMethod; const LangParameter: String;
   const Method: TSetupLanguageDetectionMethod; const LangParameter: String;
@@ -35,7 +35,7 @@ function CreateSafeDirectory(const LimitCurrentUserSidAccess: Boolean; Path: Str
 function CreateSafeDirectory(const LimitCurrentUserSidAccess: Boolean; Path: String;
 function CreateSafeDirectory(const LimitCurrentUserSidAccess: Boolean; Path: String;
   var ErrorCode: DWORD): Boolean; overload;
   var ErrorCode: DWORD): Boolean; overload;
 function IntToBase32(Number: Longint): String;
 function IntToBase32(Number: Longint): String;
-function GenerateUniqueName(const DisableFsRedir: Boolean; Path: String;
+function GenerateUniqueNameRedir(const DisableFsRedir: Boolean; Path: String;
   const Extension: String): String;
   const Extension: String): String;
 
 
 implementation
 implementation
@@ -146,7 +146,7 @@ begin
   end;
   end;
 end;
 end;
 
 
-function GenerateUniqueName(const DisableFsRedir: Boolean; Path: String;
+function GenerateUniqueNameRedir(const DisableFsRedir: Boolean; Path: String;
   const Extension: String): String;
   const Extension: String): String;
 var
 var
   Rand, RandOrig: Longint;
   Rand, RandOrig: Longint;
@@ -177,7 +177,7 @@ var
   ErrorCode: DWORD;
   ErrorCode: DWORD;
 begin
 begin
   while True do begin
   while True do begin
-    Dir := GenerateUniqueName(False, GetTempDir, '.tmp');
+    Dir := GenerateUniqueNameRedir(False, GetTempDir, '.tmp');
     if CreateSafeDirectory(LimitCurrentUserSidAccess, Dir, ErrorCode, Protected) then
     if CreateSafeDirectory(LimitCurrentUserSidAccess, Dir, ErrorCode, Protected) then
       Break;
       Break;
     if ErrorCode <> ERROR_ALREADY_EXISTS then
     if ErrorCode <> ERROR_ALREADY_EXISTS then
@@ -235,7 +235,7 @@ begin
     WM_QUERYENDSESSION and WM_ENDSESSION messages. }
     WM_QUERYENDSESSION and WM_ENDSESSION messages. }
 end;
 end;
 
 
-procedure DelayDeleteFile(const DisableFsRedir: Boolean; const Filename: String;
+procedure DelayDeleteFileRedir(const DisableFsRedir: Boolean; const Filename: String;
   const MaxTries, FirstRetryDelayMS, SubsequentRetryDelayMS: Integer);
   const MaxTries, FirstRetryDelayMS, SubsequentRetryDelayMS: Integer);
 { Attempts to delete Filename up to MaxTries times, retrying if the file is
 { Attempts to delete Filename up to MaxTries times, retrying if the file is
   in use. It sleeps FirstRetryDelayMS msec after the first try, and
   in use. It sleeps FirstRetryDelayMS msec after the first try, and