소스 검색

Show only .issig's name in issigverify errors instead of entire path. Also add comments.

Martijn Laan 3 달 전
부모
커밋
b89694a460
3개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 2
      Components/PathFunc.pas
  2. 2 1
      Projects/Src/Compiler.SetupCompiler.pas
  3. 2 1
      Projects/Src/Setup.Install.pas

+ 2 - 2
Components/PathFunc.pas

@@ -365,8 +365,8 @@ end;
 
 function PathExtractName(const Filename: String): String;
 { Returns the filename portion of Filename (e.g. 'filename.txt'). If Filename
-  ends in a slash or consists only of a drive part, the result will be an empty
-  string.
+  ends in a slash or consists only of a drive part or is empty, the result will
+  be an empty string.
   This function is essentially the opposite of PathExtractPath. }
 var
   I: Integer;

+ 2 - 1
Projects/Src/Compiler.SetupCompiler.pas

@@ -6612,8 +6612,9 @@ const
      SCompilerVerificationKeyNotFound, SCompilerVerificationSignatureBad,
      SCompilerVerificationFileSizeIncorrect, SCompilerVerificationFileHashIncorrect);
 begin
+  { Also see Setup.Install for a similar function }
   AbortCompileFmt(SCompilerSourceFileVerificationFailed,
-    [AFilename, Format(Messages[AError], [ASigFilename])]); { Not all messages actually have a %s parameter but that's OK }
+    [AFilename, Format(Messages[AError], [PathExtractName(ASigFilename)])]); { Not all messages actually have a %s parameter but that's OK }
 end;
 
 procedure TSetupCompiler.Compile;

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

@@ -271,9 +271,10 @@ const
     (msgVerificationSignatureDoesntExist, msgVerificationSignatureInvalid, msgVerificationKeyNotFound,
      msgVerificationSignatureInvalid, msgVerificationFileSizeIncorrect, msgVerificationFileHashIncorrect);
 begin
+  { Also see Compiler.SetupCompiler for a similar function }
   Log('ISSig verification error: ' + AddPeriod(LogMessages[AError]));
   raise Exception.Create(FmtSetupMessage1(msgSourceVerificationFailed,
-    FmtSetupMessage1(SetupMessageIDs[AError], ASigFilename))); { Not all messages actually have a %1 parameter but that's OK }
+    FmtSetupMessage1(SetupMessageIDs[AError], PathExtractName(ASigFilename)))); { Not all messages actually have a %1 parameter but that's OK }
 end;
 
 procedure DoISSigVerify(const SourceF: TFile; const SourceFS: TFileStream;