Browse Source

Clarify. No actual changes.

Martijn Laan 3 months ago
parent
commit
9fc13edf0d
2 changed files with 20 additions and 20 deletions
  1. 14 14
      Projects/Src/Setup.Install.pas
  2. 6 6
      Projects/Src/Setup.MainFunc.pas

+ 14 - 14
Projects/Src/Setup.Install.pas

@@ -956,7 +956,7 @@ var
     TOverwriteAll = (oaUnknown, oaOverwrite, oaKeep);
     TOverwriteAll = (oaUnknown, oaOverwrite, oaKeep);
 
 
   procedure ProcessFileEntry(const CurFile: PSetupFileEntry;
   procedure ProcessFileEntry(const CurFile: PSetupFileEntry;
-    const DisableFsRedir: Boolean; ASourceFile, ADestName: String;
+    const DisableFsRedir: Boolean; AExternalSourceFile, ADestFile: String;
     const FileLocationFilenames: TStringList; const AExternalSize: Integer64;
     const FileLocationFilenames: TStringList; const AExternalSize: Integer64;
     var ConfirmOverwriteOverwriteAll, PromptIfOlderOverwriteAll: TOverwriteAll;
     var ConfirmOverwriteOverwriteAll, PromptIfOlderOverwriteAll: TOverwriteAll;
     var WarnedPerUserFonts: Boolean);
     var WarnedPerUserFonts: Boolean);
@@ -1188,10 +1188,10 @@ var
           case CurFile^.FileType of
           case CurFile^.FileType of
             ftUninstExe: DestFile := UninstallExeFilename;
             ftUninstExe: DestFile := UninstallExeFilename;
           else
           else
-            if ADestName = '' then
+            if ADestFile = '' then
               DestFile := ExpandConst(CurFile^.DestName)
               DestFile := ExpandConst(CurFile^.DestName)
             else
             else
-              DestFile := ADestName;
+              DestFile := ADestFile;
           end;
           end;
           DestFile := PathExpand(DestFile);
           DestFile := PathExpand(DestFile);
         except
         except
@@ -1234,7 +1234,7 @@ var
           CurFileDateValid := True;
           CurFileDateValid := True;
         end
         end
         else
         else
-          CurFileDateValid := GetFileDateTime(DisableFsRedir, ASourceFile, CurFileDate); {!!!}
+          CurFileDateValid := GetFileDateTime(DisableFsRedir, AExternalSourceFile, 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
@@ -1265,8 +1265,8 @@ var
               CurFileVersionInfo.LS := CurFileLocation^.FileVersionLS;
               CurFileVersionInfo.LS := CurFileLocation^.FileVersionLS;
             end
             end
             else
             else
-              CurFileVersionInfoValid := GetVersionNumbersRedir(DisableFsRedir,
-                PathExpand(ASourceFile), CurFileVersionInfo);
+              CurFileVersionInfoValid := GetVersionNumbersRedir(DisableFsRedir, {!!!}
+                PathExpand(AExternalSourceFile), CurFileVersionInfo);
             if CurFileVersionInfoValid then
             if CurFileVersionInfoValid then
               LogFmt('Version of our file: %u.%u.%u.%u',
               LogFmt('Version of our file: %u.%u.%u.%u',
                 [LongRec(CurFileVersionInfo.MS).Hi, LongRec(CurFileVersionInfo.MS).Lo,
                 [LongRec(CurFileVersionInfo.MS).Hi, LongRec(CurFileVersionInfo.MS).Lo,
@@ -1318,7 +1318,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 := GetSHA256OfFile(DisableFsRedir, AExternalSourceFile); {!!!}
                         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 }
@@ -1451,7 +1451,7 @@ var
         Log('Installing the file.');
         Log('Installing the file.');
 
 
         { Locate source file }
         { Locate source file }
-        SourceFile := ASourceFile;
+        SourceFile := AExternalSourceFile; { Empty string if not external }
         if DisableFsRedir = InstallDefaultDisableFsRedir then begin
         if DisableFsRedir = InstallDefaultDisableFsRedir then begin
           { If the file is compressed in the setup package, has the same file
           { If the file is compressed in the setup package, has the same file
             already been copied somewhere else? If so, just make a duplicate of
             already been copied somewhere else? If so, just make a duplicate of
@@ -1826,11 +1826,11 @@ var
               var SourceFile := SearchBaseDir + SearchSubDir + FileName;
               var SourceFile := SearchBaseDir + SearchSubDir + FileName;
               { Note: CurFile^.DestName only includes a a filename if foCustomDestName is set,
               { Note: CurFile^.DestName only includes a a filename if foCustomDestName is set,
                 see TSetupCompiler.EnumFilesProc.ProcessFileList }
                 see TSetupCompiler.EnumFilesProc.ProcessFileList }
-              var DestName := ExpandConst(CurFile^.DestName);
+              var DestFile := ExpandConst(CurFile^.DestName);
               if not(foCustomDestName in CurFile^.Options) then
               if not(foCustomDestName in CurFile^.Options) then
-                DestName := DestName + SearchSubDir + FileName
+                DestFile := DestFile + SearchSubDir + FileName
               else if SearchSubDir <> '' then
               else if SearchSubDir <> '' then
-                DestName := PathExtractPath(DestName) + SearchSubDir + PathExtractName(DestName);
+                DestFile := PathExtractPath(DestFile) + SearchSubDir + PathExtractName(DestFile);
               var Size: Integer64;
               var Size: Integer64;
               Size.Hi := FindData.nFileSizeHigh;
               Size.Hi := FindData.nFileSizeHigh;
               Size.Lo := FindData.nFileSizeLow;
               Size.Lo := FindData.nFileSizeLow;
@@ -1839,7 +1839,7 @@ var
                   files is greater than when we last checked }
                   files is greater than when we last checked }
                 Size := ExpectedBytesLeft;
                 Size := ExpectedBytesLeft;
               end;
               end;
-              ProcessFileEntry(CurFile, DisableFsRedir, SourceFile, DestName, nil,
+              ProcessFileEntry(CurFile, DisableFsRedir, SourceFile, DestFile, nil,
                 Size, ConfirmOverwriteOverwriteAll, PromptIfOlderOverwriteAll,
                 Size, ConfirmOverwriteOverwriteAll, PromptIfOlderOverwriteAll,
                 WarnedPerUserFonts);
                 WarnedPerUserFonts);
               Dec6464(ExpectedBytesLeft, Size);
               Dec6464(ExpectedBytesLeft, Size);
@@ -1919,7 +1919,7 @@ var
 
 
               Result := True;
               Result := True;
               var SourceFile := ArchiveIndex.ToString; {!!!}
               var SourceFile := ArchiveIndex.ToString; {!!!}
-              const DestName = DestDir + FindData.cFileName;
+              const DestFile = DestDir + FindData.cFileName;
               var Size: Integer64;
               var Size: Integer64;
               Size.Hi := FindData.nFileSizeHigh;
               Size.Hi := FindData.nFileSizeHigh;
               Size.Lo := FindData.nFileSizeLow;
               Size.Lo := FindData.nFileSizeLow;
@@ -1928,7 +1928,7 @@ var
                   files is greater than when we last checked }
                   files is greater than when we last checked }
                 Size := ExpectedBytesLeft;
                 Size := ExpectedBytesLeft;
               end;
               end;
-              ProcessFileEntry(CurFile, DisableFsRedir, SourceFile, DestName,
+              ProcessFileEntry(CurFile, DisableFsRedir, SourceFile, DestFile,
                 nil, Size, ConfirmOverwriteOverwriteAll, PromptIfOlderOverwriteAll,
                 nil, Size, ConfirmOverwriteOverwriteAll, PromptIfOlderOverwriteAll,
                 WarnedPerUserFonts);
                 WarnedPerUserFonts);
               Dec6464(ExpectedBytesLeft, Size);
               Dec6464(ExpectedBytesLeft, Size);

+ 6 - 6
Projects/Src/Setup.MainFunc.pas

@@ -1768,12 +1768,12 @@ function EnumFiles(const EnumFilesProc: TEnumFilesProc;
 
 
             { Note: CurFile^.DestName only includes a a filename if foCustomDestName is set,
             { Note: CurFile^.DestName only includes a a filename if foCustomDestName is set,
               see TSetupCompiler.EnumFilesProc.ProcessFileList }
               see TSetupCompiler.EnumFilesProc.ProcessFileList }
-            var DestName := ExpandConst(CurFile^.DestName);
+            var DestFile := ExpandConst(CurFile^.DestName);
             if not(foCustomDestName in CurFile^.Options) then
             if not(foCustomDestName in CurFile^.Options) then
-              DestName := DestName + SearchSubDir + FindData.cFileName
+              DestFile := DestFile + SearchSubDir + FindData.cFileName
             else if SearchSubDir <> '' then
             else if SearchSubDir <> '' then
-              DestName := PathExtractPath(DestName) + SearchSubDir + PathExtractName(DestName);
-            if not EnumFilesProc(DisableFsRedir, DestName, Param) then begin
+              DestFile := PathExtractPath(DestFile) + SearchSubDir + PathExtractName(DestFile);
+            if not EnumFilesProc(DisableFsRedir, DestFile, Param) then begin
               Result := False;
               Result := False;
               Exit;
               Exit;
             end;
             end;
@@ -1824,8 +1824,8 @@ function EnumFiles(const EnumFilesProc: TEnumFilesProc;
             if IsExcluded(FindData.cFileName, Excludes) then
             if IsExcluded(FindData.cFileName, Excludes) then
               Continue;
               Continue;
 
 
-            const DestName = DestDir + FindData.cFileName;
-            if not EnumFilesProc(DisableFsRedir, DestName, Param) then
+            const DestFile = DestDir + FindData.cFileName;
+            if not EnumFilesProc(DisableFsRedir, DestFile, Param) then
               Exit(False);
               Exit(False);
           end;
           end;
         until not ArchiveFindNextFile(H, FindData);
         until not ArchiveFindNextFile(H, FindData);