You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/09/22 08:55:25 UTC

[GitHub] [cordova-electron] lordgreg edited a comment on issue #209: [windows] Cannot extract publisher name from code signing certificate. As workaround, set win.publisherName.

lordgreg edited a comment on issue #209:
URL: https://github.com/apache/cordova-electron/issues/209#issuecomment-924723149


   Hi @erisu and thank you for your feedback. I've found a bug.
   
   When building/specifying the target "appx", the publisherName is written in `builder-effective-config.yaml` under `win`. However, reading electron-builder (https://www.electron.build/configuration/appx)[docs several time], `appx` should have its own configuration written in `builder-effective-config.yaml`. That is why the appx cannot be signed as such and throws an exception.
   
   Wrong:
   ```
   directories:
     output: XXX\ionic-v5\platforms\electron\build
     buildResources: XXX\ionic-v5\platforms\electron\build-res
     app: XXX\ionic-v5\platforms\electron\www
   win:
     target:
       - target: appx
         arch:
           - x64
     icon: installer.png
   publisherName: INFO_FROM_CERT
   appId: snoot.boop
   productName: boop a snoot
   electronVersion: 14.0.0
   electronDownload:
     version: 14.0.0
   files: []
   ```
   
   Correct:
   ```
   directories:
     output: XXX\ionic-v5\platforms\electron\build
     buildResources: XXX\ionic-v5\platforms\electron\build-res
     app: XXX\ionic-v5\platforms\electron\www
   appx:
     publisher: SUBJECT_FROM_CERT
   win:
     target:
       - target: appx
         arch:
           - x64
     icon: installer.png
   appId: snoot.boop
   productName: boop a snoot
   electronVersion: 14.0.0
   electronDownload:
     version: 14.0.0
   files: []
   ```
   
   ### Current workaround:
   1. create build.json without any other addition except target:
   ```
   {
     "electron": {
       "windows": {
         "package": [
           "appx"
         ]
       }
     }
   }
   ```
   2. update package.json and add this content to it:
   ```
     "build": {
       "appx": {
         "publisher": SUBJECT_FROM_CERTIFICATE (ex: CN=aaa,E=foo@bar,O=aaa...)
       }
     }
   ```
   3. run cordova electorn build: `npx cordova build electron --release`
   4. Then use windows SignTool to sign:
   ```
   SignTool sign /tr http://timestamp.digicert.com /fd SHA256 /a /f CERTIFICATE.pfx /p PASSWORD "platforms\electron\build\*.appx"
   ```
   5. Success.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org