Click here to Skip to main content
15,885,942 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to sign my exe and msi files. I have my certificate installed in "Trusted Root Certification Authorities", but I couldn't find a way to access that store so I imported my certificate CA (.cer) to "MyCertStore" store. I tried to sign my exe file using the following command :

signtool sign /v /s MyCertStore /n "My comany Title" /t http://times
tamp.verisign.com/scripts/timestamp.dll <fullpath>\bin\Debug\MyApplication.exe
The following certificate was selected:
    Issued to: My comany Title CA
    Issued by: My comany Title CA
    Expires:   Sun Jan 01 05:29:59 2040
    SHA1 hash: 

Done Adding Additional Store
SignTool Error: The file is being used by another process.
SignTool Error: An error occurred while attempting to sign: ...\bin\Debug\UltimateVPN.exe

Number of files successfully Signed: 0
Number of warnings: 0
Number of errors: 1

D:\Myapplication>signtool verify Myapplication.exe
SignTool Error: A certificate chain processed, but terminated in a root
        certificate which is not trusted by the trust provider.

Number of errors: 1 
</fullpath>


After this I treid to run my exe file and it showed me my company name as Publisher. But signing and verify both gives error. Can anybody help me know what is this error and why am I getting it.

I never thought signing an application would be this problematic - I am trying from so many days but no success yet. Once am successful in this I want to implement the same in PostBuild, but command line is only not successfully.....
I also know that for msi, I got to sign the exe present in \obj\Debug folder.
I have referred many signtool sites and forums for soem help. Many gave me different types of knowledge but none could help me get my work done.
My exe file uses my dll file which is not signed.

I am on Win 7 and VS 2008. Please help me to get the application, msi & dll files signed. I really need help - am tired doing experiments without any success. Kindly help me at the earliest.
Posted

@Mehdi Gholam, Not necessary that we need a key to sign an application. Using Verisign withour password key is also possible.

I GOT SOLUTION to my problem :

Well, sometimes it works perfectly well and sometimes it just fails for signing also.

Cause of Failure for Verify : Signtool provided by MS doesn't support to verify CA Certificate. Check this @Anthony Nel's resposne[^]

Cause of Failure for Signing : Probably timestamp which doesn't work always. If I provide the same command again, it works perfectly well.

Added the commands in PostBuild also and it does the job well (as I said if 1st time it creates error, build 2nd time and it works).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900