Jeff Steinkamp 1 Posted January 6, 2023 I am having a devil of a time trying to sign the compiled application file using the post build events. I have the following command in the post build events: signtool.exe sign /tr http://timestamp.digicert.com /f C:\Users\n7yg\OneDrive\Comodo\steinkamp.pfx /p MyPassword $(OUTPUTPATH) But I am getting the following error: [Exec Error] The command "signtool.exe sign /tr http://timestamp.digicert.com /f C:\Users\n7yg\OneDrive\Comodo\steinkamp.pfx /p MyPassword C:\Users\n7yg\Embarcadero\Studio\Projects\CallSearch\Win32\Release\CallSearch.exe" exited with code 9009. Now, I can copy and paste that whole command into a Command Window, and it runs fine and signs the file. So, what is going on with the IDE? It is possible the IDE still has an open hook to the executable when it tries to run the post build events? Share this post Link to post
Mark- 29 Posted January 6, 2023 SWAG, did you trying providing the full path to signtool.exe? Share this post Link to post
tinyBigGAMES 59 Posted January 6, 2023 Put in a .bat file and then call the .bat file from the post build event. Share this post Link to post
Lars Fosdal 1792 Posted January 7, 2023 9009 = file not found. Does $(OUTPUTPATH) contain the actual exe file? And is the path to the certificate correct? 1 Share this post Link to post
Rickard Johansson 8 Posted January 9, 2023 Always place paths inside quotes. E.g. signtool.exe sign /tr http://timestamp.digicert.com /f "C:\Users\n7yg\OneDrive\Comodo\steinkamp.pfx" /p MyPassword "$(OUTPUTPATH)" Share this post Link to post
Lars Fosdal 1792 Posted January 10, 2023 On 1/9/2023 at 1:25 PM, Rickard Johansson said: Always place paths inside quotes. The given example does not have any spaces in the references, so quotes won't help for those - otherwise I agree. Share this post Link to post
Lars Fosdal 1792 Posted January 10, 2023 Note that as an alternative to post-build events in the IDE, you can use a build server - such as Continua CI. We use that. It triggers after a commit to Git, increment versions, builds, runs unit tests, and translates, signs, package and copy the variants to their respective staging shares, and creates a zipped copy. Amazing time saver that ensure all builds are consistently handled. Share this post Link to post
David Champion 48 Posted January 10, 2023 Adding to what Lars has said about Continua CI; if you use Final Builder as a Build Runner within Continua CI you can setup and test the build scripts visually. There is an example script in Final Builder for Code Signing and Time Stamping your code. Share this post Link to post