diff --git a/src/codeSign.ts b/src/codeSign.ts index dd8a5f0ede5..623f870239c 100644 --- a/src/codeSign.ts +++ b/src/codeSign.ts @@ -89,7 +89,7 @@ export async function createKeychain(keychainName: string, cscLink: string, cscK ]) .then(() => importCerts(keychainName, certPaths, >[cscKeyPassword, cscIKeyPassword].filter(it => it != null))), errorOccurred => { - const tasks = certPaths.map((it, index) => certLinks[index].startsWith("file://") ? BluebirdPromise.resolve() : deleteFile(it, true)) + const tasks = certPaths.map((it, index) => certLinks[index].startsWith("https://") ? deleteFile(it, true) : BluebirdPromise.resolve()) if (errorOccurred) { tasks.push(deleteKeychain(keychainName)) } diff --git a/src/winPackager.ts b/src/winPackager.ts index 3f2f4c22533..2320c64eedf 100644 --- a/src/winPackager.ts +++ b/src/winPackager.ts @@ -27,6 +27,7 @@ export class WinPackager extends PlatformPackager { super(info) const certificateFile = this.platformSpecificBuildOptions.certificateFile + const cscLink = this.options.cscLink if (certificateFile != null) { const certificatePassword = this.platformSpecificBuildOptions.certificatePassword || this.getCscPassword() this.cscInfo = BluebirdPromise.resolve({ @@ -34,10 +35,12 @@ export class WinPackager extends PlatformPackager { password: certificatePassword == null ? null : certificatePassword.trim(), }) } - else if (this.options.cscLink != null) { - this.cscInfo = downloadCertificate(this.options.cscLink) + else if (cscLink != null) { + this.cscInfo = downloadCertificate(cscLink) .then(path => { - cleanupTasks.push(() => deleteFile(path, true)) + if (cscLink.startsWith("https://")) { + cleanupTasks.push(() => deleteFile(path, true)) + } return { file: path, password: this.getCscPassword(),