7

This is a very simple question. What should I write in Delphi post build events to execute a coomand line tool?

I wrote this:

c:\BinPath\signtool.exe sign /f c:\BinPath\Mypfxfile.pfx /p MyPassword 
/t http:// timestamp.verisign.com/scripts/timstamp.dll c:\BinPath\Project1.exe

(where c:\BinPath is the Delphi output path, for simplicity I copied signtool.exe adn pfx file in the same folder)

as i build the project I have this modal window error:

--------------------------- Project 1- CodeGear Delphi for Microsoft Windows - Form1 --------------------------- Cannot open file "C:\SourcePath\EXEC". Impossible to find the specified path..

and in the messages I have

[Exec Error] EXEC(1): "SignerTimeStamp() failed." (-2147467259/0x80004005)

[Exec Error] exit from command "c:\BinPath\signtool.exe sign /f c:\BinPath\Mypfxfile.pfx /p MyPassword /t http:// timestamp.verisign.com/scripts/timstamp.dll c:\BinPath\Project1.exee" with code 1.

How to manage this? In Delphi help I read (from Creating Build Events topic):

Enter the build commands, one command per line, and press Return after entering each command. Commands consist of any valid DOS command, such as: copy $() c:\Built\$()

So i simply inserted in the build event what (c:\BinPath\....Project1.exe) I was able to run from command prompt. Where is the error? Thanks.

UnDiUdin
  • 14,924
  • 39
  • 151
  • 249

1 Answers1

6

I could have deleted this question, since I found the problem, but I think it is better to leave it since it can be useful for others:

THE PROBLEM WAS SIMPLY

http:// timestamp...

of course should be

http://timestamp...

when copying on build event I inserted an extra space by mistake. By reading the question posted I found the error...

UnDiUdin
  • 14,924
  • 39
  • 151
  • 249
  • 2
    Asking the question often answers it. +1 in both the Q and the A for not deleting them: these "duh" moments are important, as they happen too all of us every now and then. I'm not ashamed of them (just the other day I called a DLL function that expected a PAnsiChar with a PUnicodeChar - how "duh" is that ) and I'm glad others aren't either. – Jeroen Wiert Pluimers Nov 18 '10 at 16:24
  • @vcldeveloper: Stack Overflow tells me that I can accept my own answer in 2 days. – UnDiUdin Nov 18 '10 at 22:01
  • @Jeroen Yes. We learn by mistakes. Sometimes we need others to tell us about our mistakes, sometimes we just need ourselves, and in this second case I feel at home ("duh" moment, but also "I made it" moment)... – UnDiUdin Nov 18 '10 at 22:02