Jump to content
Jeff Steinkamp

Digitally Sign Applicaiton

Recommended Posts

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

9009 = file not found.  

Does $(OUTPUTPATH) contain the actual exe file?

And is the path to the certificate correct?

  • Like 1

Share this post


Link to post
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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×