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:
- Created 7 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Issue not in the space (printed as not escaped, but executed correctly, I am sure). Strange.
10.2.0