Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to sign electron app using electron forge?

I am using electron forge for building and packaging my electron app.

How can I code sign my app (using electron forge) for windows and mac?

Electrong-forge: https://github.com/electron-userland/electron-forge

like image 918
galusben Avatar asked Sep 29 '17 02:09

galusben


People also ask

How do you run electron Forge?

To install electron-forge, run npm i -g electron-forge . Once installed, it can either scaffold a new project with the electron-forge init command or import an exiting project with the electron-forge import command.


2 Answers

Use packagerConfig key in your package.json.

Electron Forge uses Electron Packager under the hood and allows you to set the Electron Packager configuration in your package.json.

Here's an extract of what mine looks like in order to sign our packaged application file:

package.json

{ 
  "config": {
    "forge": {
      "packagerConfig": {
        "osxSign": {
          "identity": "Developer ID Application: Joshua Pinter (<your_key_code>)"
        }
      }
    }
  }
}

You can see that all the Electron Packager configurations can be put under the packagerConfig key.

NOTE: In older versions of Electron Forge, this was called electronPackagerConfig instead of packagerConfig.

like image 57
Joshua Pinter Avatar answered Sep 23 '22 17:09

Joshua Pinter


electronPackagerConfig is now packagerConfig, e.g.:

{ 
  "config": {
    "forge": {
      "packagerConfig": {
        "osxSign": {
          "identity": "Developer ID Application: Company (id)"
        }
      }
    }
  }
}

like image 32
Ed McManus Avatar answered Sep 22 '22 17:09

Ed McManus