uav4geo / GCPEditorPro

Amazingly fast and simple ground control points interface. ◎
https://gcp.uav4geo.com
Other
55 stars 17 forks source link

Problem with dist.bat electron-build failing #1

Open jackfrost2013 opened 4 years ago

jackfrost2013 commented 4 years ago

When running the dist.bat in an admin cmd on windows 10 electron-build fails. Seems to be an issue with the certificate. Included relevant debug log. 2020-04-28T19_55_34_513Z-debug.log

WARNING in budgets: Exceeded maximum budget for initial-es2015. Budget 2 MB was not met by 372 kB with a total of 2.36 MB.

WARNING in budgets: Exceeded maximum budget for initial-es5. Budget 2 MB was not met by 537 kB with a total of 2.52 MB.

> gcp-editor-pro@1.0.0 dist C:\Build\GCPEditorPro-master
> electron-builder

  • electron-builder  version=22.5.1 os=10.0.18363
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=dist\builder-effective-config.yaml
  • packaging       platform=win32 arch=x64 electron=8.2.4 appOutDir=dist\win-unpacked
  • empty password will be used for code signing  reason=CSC_KEY_PASSWORD is not defined
  ⨯ open d:\comodo.pfx: The device is not ready.
  ⨯ Cannot extract publisher name from code signing certificate. As workaround, set win.publisherName. Error: Error: C:\Build\GCPEditorPro-master\node_modules\app-builder-bin\win\x64\app-builder.exe exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
    at ChildProcess.<anonymous> (C:\Build\GCPEditorPro-master\node_modules\builder-util\src\util.ts:243:14)
    at Object.onceWrapper (events.js:417:26)
    at ChildProcess.emit (events.js:310:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)  stackTrace=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       Error: Cannot extract publisher name from code signing certificate. As workaround, set win.publisherName. Error: Error: C:\Build\GCPEditorPro-master\node_modules\app-builder-bin\win\x64\app-builder.exe exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           at ChildProcess.<anonymous> (C:\Build\GCPEditorPro-master\node_modules\builder-util\src\util.ts:243:14)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           at Object.onceWrapper (events.js:417:26)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           at ChildProcess.emit (events.js:310:20)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           at maybeClose (internal/child_process.js:1021:16)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        at getCertInfo (C:\Build\GCPEditorPro-master\node_modules\app-builder-lib\src\codeSign\windowsCodeSign.ts:85:11)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                at processTicksAndRejections (internal/process/task_queues.js:97:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gcp-editor-pro@1.0.0 dist: `electron-builder`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gcp-editor-pro@1.0.0 dist script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
pierotofy commented 4 years ago

Thanks for the report @jackfrost2013, yes this seems a bug due to the path of the signing certificate. I suspect most users don't need to sign the executable, but I'm not sure how to specify a logic to "sign only if a certificate is available".

A workaround would be to remove the certificate reference from https://github.com/uav4geo/GCPEditorPro/blob/master/package.json#L29

and-viceversa commented 3 years ago

It looks like the same thing occurs on macOS Big Sur.

> gcp-editor-pro@1.1.0 dist
> ./node_modules/.bin/electron-builder

  • electron-builder  version=22.10.5 os=20.3.0
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=dist/builder-effective-config.yaml
  • packaging       platform=darwin arch=x64 electron=8.5.5 appOutDir=dist/mac
  • Unpacking electron zip  zipPath=undefined
  • skipped macOS application code signing  reason=cannot find valid "Developer ID Application" identity or custom non-Apple code signing certificate, see https://electron.build/code-signing allIdentities=
                                                   0 identities found

                                                Valid identities only
                                                   0 valid identities found
  ⨯ No authentication properties provided (e.g. appleId, appleApiKey)  stackTrace=
                                                                         Error: No authentication properties provided (e.g. appleId, appleApiKey)
                                                                             at Object.validateAuthorizationArgs (/Users/labmac/programs/GCPEditorPro/node_modules/electron-notarize/src/validate-args.ts:51:9)
                                                                             at authorizationArgs (/Users/labmac/programs/GCPEditorPro/node_modules/electron-notarize/src/index.ts:43:16)
                                                                             at /Users/labmac/programs/GCPEditorPro/node_modules/electron-notarize/src/index.ts:78:10
                                                                             at Generator.next (<anonymous>)
                                                                             at fulfilled (/Users/labmac/programs/GCPEditorPro/node_modules/electron-notarize/lib/index.js:4:58)
                                                                             at processTicksAndRejections (node:internal/process/task_queues:94:5)

Is there a similar workaround?