Skip to content

Commit 04a88b0

Browse files
committed
fix: Certificate file for sign was gone (provides with file://) under windows
Closes #619
1 parent 6d8aaab commit 04a88b0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/codeSign.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export async function createKeychain(keychainName: string, cscLink: string, cscK
8989
])
9090
.then<CodeSigningInfo>(() => importCerts(keychainName, certPaths, <Array<string>>[cscKeyPassword, cscIKeyPassword].filter(it => it != null))),
9191
errorOccurred => {
92-
const tasks = certPaths.map((it, index) => certLinks[index].startsWith("file://") ? BluebirdPromise.resolve() : deleteFile(it, true))
92+
const tasks = certPaths.map((it, index) => certLinks[index].startsWith("https://") ? deleteFile(it, true) : BluebirdPromise.resolve())
9393
if (errorOccurred) {
9494
tasks.push(deleteKeychain(keychainName))
9595
}

src/winPackager.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,20 @@ export class WinPackager extends PlatformPackager<WinBuildOptions> {
2727
super(info)
2828

2929
const certificateFile = this.platformSpecificBuildOptions.certificateFile
30+
const cscLink = this.options.cscLink
3031
if (certificateFile != null) {
3132
const certificatePassword = this.platformSpecificBuildOptions.certificatePassword || this.getCscPassword()
3233
this.cscInfo = BluebirdPromise.resolve({
3334
file: certificateFile,
3435
password: certificatePassword == null ? null : certificatePassword.trim(),
3536
})
3637
}
37-
else if (this.options.cscLink != null) {
38-
this.cscInfo = downloadCertificate(this.options.cscLink)
38+
else if (cscLink != null) {
39+
this.cscInfo = downloadCertificate(cscLink)
3940
.then(path => {
40-
cleanupTasks.push(() => deleteFile(path, true))
41+
if (cscLink.startsWith("https://")) {
42+
cleanupTasks.push(() => deleteFile(path, true))
43+
}
4144
return {
4245
file: path,
4346
password: this.getCscPassword(),

0 commit comments

Comments
 (0)