Skip to content

Commit

Permalink
maybe see if adding a windows' certificateSHA1 option works
Browse files Browse the repository at this point in the history
  • Loading branch information
ccnokes committed Feb 24, 2017
1 parent 7bd11e1 commit c2029a1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/electron-builder/src/options/winOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
*/
Expand Down
9 changes: 9 additions & 0 deletions packages/electron-builder/src/windowsCodeSign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down

0 comments on commit c2029a1

Please sign in to comment.