Skip to content

Commit 8f6247a

Browse files
committed
fix: artifactName for portable
Close #1340
1 parent 2e7b668 commit 8f6247a

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

packages/electron-builder/src/targets/nsis.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default class NsisTarget extends Target {
3333

3434
let options = this.packager.config.nsis || Object.create(null)
3535
if (targetName !== "nsis") {
36-
options = Object.assign(options, (<any>this.packager.config)[targetName === "nsis-web" ? "nsisWeb" : ""])
36+
options = Object.assign(options, (<any>this.packager.config)[targetName === "nsis-web" ? "nsisWeb" : targetName])
3737
}
3838
this.options = options
3939

test/out/windows/__snapshots__/installerTest.js.snap

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ Object {
4949
}
5050
`;
5151

52+
exports[`portable - artifactName 1`] = `
53+
Object {
54+
"win": Array [
55+
Object {
56+
"file": "Test App ßWPortable.1.1.0.exe",
57+
"safeArtifactName": "TestApp-1.1.0.exe",
58+
},
59+
],
60+
}
61+
`;
62+
5263
exports[`portable 1`] = `
5364
Object {
5465
"win": Array [

test/src/windows/installerTest.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,16 @@ test.ifNotCiMac("portable", app({
121121
nsis: {
122122
}
123123
}
124+
}))
125+
126+
test.ifAll.ifNotCiMac("portable - artifactName", app({
127+
targets: Platform.WINDOWS.createTarget(["portable"]),
128+
config: {
129+
"nsis": {
130+
"artifactName": "${productName}Installer.${version}.${ext}"
131+
},
132+
"portable": {
133+
"artifactName": "${productName}Portable.${version}.${ext}"
134+
}
135+
}
124136
}))

0 commit comments

Comments
 (0)