Skip to content

Commit bfd6635

Browse files
committed
fix: use lowercased safe artifact name if app name is lowercased
1 parent d99a27e commit bfd6635

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ export default class WebInstallerTarget extends NsisTarget {
3939
}
4040

4141
protected generateGitHubInstallerName(): string {
42-
return `${this.packager.appInfo.name}-WebSetup-${this.packager.appInfo.version}.exe`
42+
const appInfo = this.packager.appInfo
43+
const classifier = appInfo.name.toLowerCase() === appInfo.name ? "web-setup" : "WebSetup"
44+
return `${appInfo.name}-${classifier}-${appInfo.version}.exe`
4345
}
4446
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ export default class NsisTarget extends Target {
180180
}
181181

182182
protected generateGitHubInstallerName() {
183-
return `${this.packager.appInfo.name}-${this.isPortable ? "" : "Setup-"}${this.packager.appInfo.version}.exe`
183+
const appInfo = this.packager.appInfo
184+
const classifier = appInfo.name.toLowerCase() === appInfo.name ? "setup-" : "Setup-"
185+
return `${appInfo.name}-${this.isPortable ? "" : classifier}${appInfo.version}.exe`
184186
}
185187

186188
private get isUnicodeEnabled() {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Object {
55
"win": Array [
66
Object {
77
"file": "Test Custom Installation Dir Setup 1.1.0.exe",
8-
"safeArtifactName": "test-custom-inst-dir-Setup-1.1.0.exe",
8+
"safeArtifactName": "test-custom-inst-dir-setup-1.1.0.exe",
99
},
1010
],
1111
}
@@ -21,7 +21,7 @@ Object {
2121

2222
exports[`allowToChangeInstallationDirectory 3`] = `
2323
Object {
24-
"githubArtifactName": "test-custom-inst-dir-Setup-1.1.0.exe",
24+
"githubArtifactName": "test-custom-inst-dir-setup-1.1.0.exe",
2525
"path": "Test Custom Installation Dir Setup 1.1.0.exe",
2626
"version": "1.1.0",
2727
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Object {
2929
"win": Array [
3030
Object {
3131
"file": "Test Menu Category CustomName 1.1.0.exe",
32-
"safeArtifactName": "test-menu-category-Setup-1.1.0.exe",
32+
"safeArtifactName": "test-menu-category-setup-1.1.0.exe",
3333
},
3434
],
3535
}

0 commit comments

Comments
 (0)