From c2029a12644981930f68f9d8e413b2349b2ba357 Mon Sep 17 00:00:00 2001 From: Cameron Nokes Date: Thu, 23 Feb 2017 21:00:57 -0700 Subject: [PATCH] maybe see if adding a windows' certificateSHA1 option works --- packages/electron-builder/src/options/winOptions.ts | 5 +++++ packages/electron-builder/src/windowsCodeSign.ts | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/packages/electron-builder/src/options/winOptions.ts b/packages/electron-builder/src/options/winOptions.ts index 9bec210c5d3..671b6713169 100644 --- a/packages/electron-builder/src/options/winOptions.ts +++ b/packages/electron-builder/src/options/winOptions.ts @@ -47,6 +47,11 @@ export interface WinBuildOptions extends PlatformSpecificBuildOptions { */ readonly certificateSubjectName?: string + /** + SHA1 of the certificate to sign with. + */ + readonly certificateSHA1?: string + /** The URL of the RFC 3161 time stamp server. Defaults to `http://timestamp.comodoca.com/rfc3161`. */ diff --git a/packages/electron-builder/src/windowsCodeSign.ts b/packages/electron-builder/src/windowsCodeSign.ts index 9a3da7f23db..32255e5d4ab 100644 --- a/packages/electron-builder/src/windowsCodeSign.ts +++ b/packages/electron-builder/src/windowsCodeSign.ts @@ -90,6 +90,15 @@ async function spawnSign(options: SignOptions, inputPath: string, outputPath: st } } + if (options.options.certificateSHA1) { + if (isWin) { + args.push("/sha1", options.options.certificateSHA1) + } + else { + throw new Error("certificateSHA1 supported only on Windows") + } + } + if (!isWin || hash !== "sha1") { args.push(isWin ? "/fd" : "-h", hash) if (isWin && process.env.ELECTRON_BUILDER_OFFLINE !== "true") {