Digital signing - Advanced Installer Community
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Digital signing

Hello,
I have added Digital Signature to my project.
Settings: "use file from disk" (pfx), "store encrypted password in project file", "Timestamp url"(verisign) and "enable installing of patches without elevation".
During sign phase Advanced Installer displays "digisign.exe error. The certificate is missing or it cannot be used for signing."
Then I read this topics:
http://www.advancedinstaller.com/forums ... =2&t=20368
http://www.advancedinstaller.com/forums ... =2&t=26855
viewtopic.php?f=2&t=20199
http://www.advancedinstaller.com/forums ... =2&t=26016
After I've installed Microsoft SDK and Microsoft CAPICOM 2.1.0.2 SDK problem still was there. Then I added signtool as external tool for digital signatures and it helped.
But the problem is that I can specify external tool only for current logged user. So when my buildserver builds advanced installer project on this Windows PC with another user (i.e. "Jenkins") it fails with digisign.exe error because it doesn't know about overrided signtool setting.

Is it possible to set external tool for every user on PC?
Or may be you know how to fix the problem with digisign.exe?

Best regards,
Andrey
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: Digital signing

I found workaround and set up external tool for buildserver.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Digital signing

Hello Andrey,

First of all I apologize for my delayed reply.

I'm glad you overcame the related issue. The "External Tools" options are only per-user options, so as you already proceeded, in order to enable the above option for all users on a machine you should manually activate it for each user within Advanced Installer UI.

If you have any question let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: Digital signing

Hello Daniel,
There is a problem with digital signing using external tool. If I sign manuall with command:

Code: Select all

signtool.exe sign /a /f <key>.pfx /p <pwd> /t http://timestamp.verisign.com/scripts/timstamp.dll /du <url> MyProduct.msi
everything is fine and I can see that signature is correct by checking file properties with windows explorer.

But if I use Advanced Installer signing (by selecting "Enable signing" in Digital Signature page) the signature is added but it "cannot be verified".

How can I fix signing by Advanced Installer?
Alternately I can use my command line signing which mentioned above. Then how can I implement installation of new versions of product without elevation?
__
Best regards,
Andrey
Attachments
cert_ok.png
cert_ok.png (2.47 KiB) Viewed 25563 times
cert_fail.png
cert_fail.png (3.37 KiB) Viewed 25563 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Digital signing

Hello Andrey,

I'm not sure why this happens. I've tested the scenario but I cannot replicate the behavior. Can you confirm that you are signing (using AI and manually) and checking the "Digital Signature Information" of the signed MSI on the same machine?

When using external tools to sign the setup package Advanced Installer uses a command line like this:

Code: Select all

signtool.exe sign /f <key>.pfx /p <pwd> /t <timestamp URL> /du <url> MyProduct.msi
Can you please remove the "/a" switch from your command line when manually signing the MSI and see if the "Digital Signature Information" of the signed MSI is still different than when signing within AI?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: Digital signing

Yes I have done this checks and signings on the same machine. I have removed "/a" flag from command line and still have the correct signature.

In Digital Signature details I can see the correct certification path which includes: thawte - Thawte Code Signing CA - G2 - <my cert>
And If I sign with AI there is only <my cert> in certification path.

May be it could be fixed with "/ca" flag in sign tool command line? (According to http://stackoverflow.com/questions/6575 ... h-signtool)

Best regards,
Andrey
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Digital signing

Hello Andrey,

There should be no difference between signing from Advanced Installer application the MSI package and manually signing the MSI as long as you are using the same certificate file and the same version of "signtool.exe" file. I've tested the scenario multiple times but I cannot replicate the behavior.

Can you please make sure that you are using the same certificate file (from the same location) in both situations: when signing from AI and when manually signing?

Also, can you please make sure the "signtool.exe" path from AI -> "Options -> External Tools -> SignTool.exe" field is the same with the one specified when manually signing the MSI?

As a last attempt, can you test the scenario using different certificate files? For testing you could try to create a test certificate.

Unfortunately, we cannot investigate this further as long as we are not able to replicate the behavior on our test machines. So, if you could isolate the behavior in a detailed step by step test case which we can follow to replicate the behavior, this would be really useful for us.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Andrey
Posts: 47
Joined: Thu Jul 10, 2014 9:06 am

Re: Digital signing

Thanks for help Daniel!

You are completly right, my problem is caused by different versions of signtool.exe.
In external tool settings I set up signtool from Windows SDK 7.1: 6.1.7600.16385 (bad signature).
To sign from command line I've used the old version: 6.0.6000.16384 (good signature).

Best regards,
Andrey
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Digital signing

You're always welcome Andrey. I'm glad you sorted things out.

If you have any question let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”