Electron-builder: certificateSubjectName supported only on Windows when target is windows.

Created on 27 Apr 2017  路  3Comments  路  Source: electron-userland/electron-builder


  • Version:
    16.4.2

    1.11.1

  • Target:
    Windows


My publish script looks like this:

const builder = require('electron-builder');
const Platform = builder.Platform;

builder.build({
  targets: Platform.WINDOWS.createTarget(),
  publish: true,
  platform: 'win32',
  config: {
    appId: 'com.amdirent.opslab',
    forceCodeSigning: true,
    publish: [
      {
        provider: 's3',
        bucket: 'whatever-bucket',
        region: 'us-east-1'
      }
    ],
    win: {
      certificateSubjectName: 'A Subject Name',
      publisherName: 'My Org, Inc.'
    }
  }
})
  .catch(console.error);

When I run it, I get Error: certificateSubjectName supported only on Windows. Note that I'm on Mac, but the target is windows.

The relevant line is here: https://github.com/electron-userland/electron-builder/blob/master/packages/electron-builder/src/windowsCodeSign.ts#L87

Does this mean I cannot sign from mac? Because there's a command line command codesign that does the signing, and a Mac _can_ sign for a Windows app. Does electron-builder just not support this?

Most helpful comment

+1 i am in same situation, do have EV codesigning cert on a smartcard, it is visible on my MAC Keychain, all seems to be normal but electron-builder cannot discover it. What exactly is "certificateSubjectName" ?

All 3 comments

https://github.com/electron-userland/electron-builder/issues/1299

So electron-builder doesn't support mac EV signing a windows app.

Could you please tell me how can we use this certificateSubjectName variable in our electron code and where? I want to sign my electron app, I am using windows to create a build.

Thanks.

+1 i am in same situation, do have EV codesigning cert on a smartcard, it is visible on my MAC Keychain, all seems to be normal but electron-builder cannot discover it. What exactly is "certificateSubjectName" ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AidanNichol picture AidanNichol  路  3Comments

mstralka picture mstralka  路  3Comments

lbssousa picture lbssousa  路  3Comments

leo picture leo  路  3Comments

NPellet picture NPellet  路  3Comments