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.

Code signing on Windows fails when space in path

See original GitHub issue
  • Version: 7.11.4
  • Target: Windows (on Windows)

Building and signing my app on Windows for Windows results in the following error:

Signing My App.exe (certificate file "C:\Users\eriedl\AppData\Local\Temp\electron-builder-qZd8Ot\t-d18-0.p12")
  electron-builder Executing C:\Users\eriedl\.cache\winCodeSign\winCodeSign-1.4.2\windows-10\signtool.exe sign /t http://timestamp.verisign.com/scripts/timstamp.dll /f C:\Users\eriedl\AppData\Local\Temp\electron-builder-qZd8Ot\t-d18-0.p12 /d My App /du https://www.mycompany.io /p "password" C:\Users\eriedl\Documents\sources\ape\out\packages\win-unpacked\My App.exe +391ms
Unhandled rejection Error: Exit code: 1. Command failed: C:\Users\eriedl\.cache\winCodeSign\winCodeSign-1.4.2\windows-10\signtool.exe sign /t http://timestamp.verisign.com/scripts/timstamp.dll /f C:\Users\eriedl\AppData\Local\Temp\electron-builder-qZd8Ot\t-d18-0.p12 /d My App /du https://www.mycompany.io /p "password" C:\Users\eriedl\Documents\sources\ape\out\packages\win-unpacked\My App.exe
SignTool Error: An error occurred while attempting to load the signing
        certificate from: C:\Users\eriedl\AppData\Local\Temp\electron-builder-qZd8Ot\t-d18-0.p12

When I try to manually sign the executable, I also get an error. However, as soon as I surround all argument values that contain a space with double quotes, the signing works just fine:

C:\Users\eriedl\.cache\winCodeSign\winCodeSign-1.4.2\windows-10\signtool.exe sign /t http://timestamp.verisign.com/scripts/timstamp.dll /f resources\cert-store-authenticode.p12 /d "My App" /du https://www.mycompany.io /p "password" out\packages\win-unpacked\My App.exe
Done Adding Additional Store
Successfully signed: out\packages\win-unpacked\My App.exe

It might be a good idea to surround all paths with double quotes including the temporary path to signtool.exe, the p12 file, description option and executable.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
develarcommented, Oct 11, 2016

Issue not in the space (printed as not escaped, but executed correctly, I am sure). Strange.

0reactions
develarcommented, Nov 29, 2016

10.2.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Signing with full path with spaces to signtool ... - Stack Overflow
Open a command window with elevated privileges · Change to a directory I created with no space in the name: cd \bin ·...
Read more >
Signing With Full Path With Spaces To Signtool.Exe ... - ADocLib
A warning error code 0 initially will be thrown if /fd is not specified Sign Tool expects to find only one valid signing...
Read more >
Troubleshooting packaging, deployment, and query of ...
Error code Value Description and possible causes E_INVALIDARG 0x80070057 ERROR_INSTALL_INVALID_ PACKAGE 0x80073CF2 The package data isn't valid. ERROR_INSTALL_NETWORK_ FAILURE 0x80073CF5 The package can't be downloaded.
Read more >
Troubleshooting Disk Management | Microsoft Learn
This topic lists a few common issues you may encounter when using Disk Management and troubleshooting steps to try. Tip. If you get...
Read more >
Test Signing - Windows drivers | Microsoft Learn
Signing the driver is required because Windows Vista and later ... that no space is allowed for the switches, /driver:<no space><full path>, ...
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