Skip to content

Commit

Permalink
fix: disable dual-signing for .msi installer
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Aug 17, 2016
1 parent 09497cc commit 903148b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions .idea/dictionaries/develar.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
Expand Down
13 changes: 10 additions & 3 deletions src/windowsCodeSign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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")
}
Expand Down

0 comments on commit 903148b

Please sign in to comment.