question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Codesign for Windows on Travis fails

See original GitHub issue

Version: 20.38.4 Target: nsis

We’re using the new Windows image over at Travis and have split up our builds so that Linux builds on the Xenial image, Mac on the OSX image and Windows/Nsis on the Windows image.

Everything works fine until we activate Codesign, the Windows build then fails on:

executing       file=C:\Users\travis\AppData\Local\electron-builder\Cache\winCodeSign\winCodeSign-2.4.0\windows-10\x64\signtool.exe args=sign /t http://timestamp.verisign.com/scripts/timstamp.dll /f C:\Users\travis\AppData\Local\Temp\t-3PzAcB\0.p12 /d <binary name> /du https://<domain-name> /p <hash> (sha256 hash) /debug C:\Users\travis\build\<path>\dist\win\win-unpacked\<binary name>.exe env={}

(binary name, domain name, hash, path removed from output)

Doing the same on a local Windows 10 machine using git bash works fine, it also works fine if we disable codesigning (by unsetting the CSC_LINK & CSC_KEY_PASSWORD variables). We tested using bash locally since that’s what Travis is using to run the build.

Any advice? Happy to share more information if needed.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

6reactions
rvanmilcommented, Nov 14, 2019

In case someone finds this issue looking for a way to fix this with Travis, I finally got this to work properly. I had to make two changes to my project which did not have any specific codesign configuation other than the WIN_CSC_LINK and WIN_CSC_KEY_PASSWORD variables.

In my .travis.yml I had to add this line to the before_install section:

certutil -p $WIN_CSC_KEY_PASSWORD -importpfx ./travis/cert.p12

And in the Electron Builder configuration I had to add the certificateSubjectName to the win section as is described over here: https://www.electron.build/configuration/win

0reactions
khrjcommented, Aug 27, 2020

How do you build the windows installer without codesigning? We depend on the CSC_LINK and CSC_KEY_PASSWORD variables to get the OSX binary signed. Below our setup which works fine for Linux and OSX but not for Windows.

If anyone comes across this in the future, this is how I got it to work:

before_install:
  - if [ "$TRAVIS_OS_NAME" = "windows" ] || [ "$TRAVIS_OS_NAME" = "linux" ]; then unset CSC_KEY_PASSWORD CSC_LINK; fi
Read more comments on GitHub >

github_iconTop Results From Across the Web

Codesigning on Windows - Travis CI Community
I'm trying to do code signing using SignTool. It seems to be some permission issues connected to this. Do the user need some...
Read more >
Common Build Problems - Travis CI Docs
If that build suddenly fails too, there's a good chance, that a dependency was updated and is causing the breakage. Check the list...
Read more >
Codesign on travis hangs build - keychain - Stack Overflow
So I have selected to run OSX Mojave 10.14 on travis VM. In order to sign my application I have created custom keychain...
Read more >
2019 SHA-2 Code Signing Support requirement for Windows ...
Stand Alone update, KB4493730 that introduce SHA-2 code sign support for the ... and I'm receiving an error 0xc0000428 (STATUS_INVALID_IMAGE_HASH) or my ...
Read more >
Cloud Code Signing Integration with Travis CI - SSL.com
export MAVEN_CLI_OPTS=”–batch-mode –errors –fail-at-end ... 8.8.8.8 –network host –volume ${TRAVIS_BUILD_DIR}/packages:/codesign/examples.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found