Skip to content

Commit

Permalink
fix: add /debug flag to signtool, do not try to use openssl on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed May 9, 2018
1 parent 7b5ffe6 commit bd77520
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/electron-builder-lib/src/winPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,18 @@ export class WinPackager extends PlatformPackager<WindowsConfiguration> {

const cscFile = (cscInfo as FileCodeSigningInfo).file
if (publisherName == null && cscFile != null) {
if (process.platform === "win32") {
try {
try {
if (process.platform === "win32") {
const subject = await this.computedPublisherSubjectOnWindowsOnly.value
const commonName = subject == null ? null : parseDn(subject).get("CN")
if (commonName) {
return asArray(commonName)
}
}
catch (e) {
log.warn({error: e.message}, "cannot get publisher name using powershell")
else {
publisherName = await extractCommonNameUsingOpenssl((cscInfo as FileCodeSigningInfo).password || "", cscFile)
}
}

try {
publisherName = await extractCommonNameUsingOpenssl((cscInfo as FileCodeSigningInfo).password || "", cscFile)
}
catch (e) {
throw new Error(`Cannot extract publisher name from code signing certificate, please file issue. As workaround, set win.publisherName: ${e.stack || e}`)
}
Expand Down
2 changes: 2 additions & 0 deletions packages/electron-builder-lib/src/windowsCodeSign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ function computeSignToolArgs(options: WindowsSignTaskConfiguration, isWin: boole
}

if (isWin) {
// https://github.com/electron-userland/electron-builder/issues/2875#issuecomment-387233610
args.push("/debug")
// must be last argument
args.push(inputFile)
}
Expand Down

0 comments on commit bd77520

Please sign in to comment.