Skip to content

使用Electron打包Windows应用程序并进行代码签名

Published: at 14:30

分为两种证书签名方式

PFX比较简单,我使用的是electron-builder打包,在electron-builder.json文件中写入配置

  "win": {
    "icon": "resources/favicon.ico",
    "target": [{ "target": "nsis", "arch": ["ia32"] }],
    "artifactName": "xxx.${ext}",
    "verifyUpdateCodeSignature": false,
    "signingHashAlgorithms": [
      "sha256",
      "sha1"
    ],
    "signDlls": true,
    "rfc3161TimeStampServer": "http://timestamp.digicert.com",
    "certificateFile": "xxx.pfx",
    "certificatePassword": "xxx"
  }

其中rfc3161TimeStampServer是时间戳服务器Url,certificateFile是使用makecert制作的证书导出后的文件,具体操作如下:

制作步骤转至https://blog.csdn.net/popozhu/article/details/5793923