diff --git a/packages/electron-builder-lib/src/winPackager.ts b/packages/electron-builder-lib/src/winPackager.ts index 9ce5977da53..b3f9ee8529b 100644 --- a/packages/electron-builder-lib/src/winPackager.ts +++ b/packages/electron-builder-lib/src/winPackager.ts @@ -105,22 +105,18 @@ export class WinPackager extends PlatformPackager { 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}`) } diff --git a/packages/electron-builder-lib/src/windowsCodeSign.ts b/packages/electron-builder-lib/src/windowsCodeSign.ts index 10dd6614e25..f21aa069bdc 100644 --- a/packages/electron-builder-lib/src/windowsCodeSign.ts +++ b/packages/electron-builder-lib/src/windowsCodeSign.ts @@ -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) }