From 903148b43d166dd7a2faa1039ba5af48f87f1540 Mon Sep 17 00:00:00 2001 From: develar Date: Wed, 17 Aug 2016 10:52:34 +0200 Subject: [PATCH] fix: disable dual-signing for .msi installer --- .idea/dictionaries/develar.xml | 1 + package.json | 4 ++-- src/windowsCodeSign.ts | 13 ++++++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.idea/dictionaries/develar.xml b/.idea/dictionaries/develar.xml index f3868690f1c..44ced67e6a9 100644 --- a/.idea/dictionaries/develar.xml +++ b/.idea/dictionaries/develar.xml @@ -98,6 +98,7 @@ signtool templating testapp + timestamping tsconfig udbz udro diff --git a/package.json b/package.json index 16baf3314c4..5a88f92f63f 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "mime": "^1.3.4", "minimatch": "^3.0.3", "normalize-package-data": "^2.3.5", - "plist": "^1.2.0", + "plist": "^2.0.1", "pretty-ms": "^2.1.0", "progress": "^1.1.8", "progress-stream": "^1.2.0", @@ -90,7 +90,7 @@ "source-map-support": "^0.4.2", "update-notifier": "^1.0.2", "uuid-1345": "^0.99.6", - "yargs": "^4.8.1" + "yargs": "^5.0.0" }, "optionalDependencies": { "appdmg": "^0.4.5" diff --git a/src/windowsCodeSign.ts b/src/windowsCodeSign.ts index 519a274a7f1..bba38c2408d 100644 --- a/src/windowsCodeSign.ts +++ b/src/windowsCodeSign.ts @@ -28,11 +28,17 @@ export interface SignOptions { export async function sign(options: SignOptions) { let hashes = options.hash - if (hashes == null) { - hashes = ["sha1", "sha256"] + // msi does not support dual-signing + if (path.extname(options.path) === ".msi") { + hashes = [hashes != null && !hashes.includes("sha1") ? "sha256" : "sha1"] } else { - hashes = Array.isArray(hashes) ? hashes.slice() : [hashes] + if (hashes == null) { + hashes = ["sha1", "sha256"] + } + else { + hashes = Array.isArray(hashes) ? hashes.slice() : [hashes] + } } const isWin = process.platform === "win32" @@ -91,6 +97,7 @@ async function spawnSign(options: SignOptions, inputPath: string, outputPath: st args.push(isWin ? "/du" : "-i", options.site) } + // msi does not support dual-signing if (nest) { args.push(isWin ? "/as" : "-nest") }