Skip to content

Commit

Permalink
fix: use lowercased safe artifact name if app name is lowercased
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Mar 22, 2017
1 parent d99a27e commit bfd6635
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion packages/electron-builder/src/targets/WebInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export default class WebInstallerTarget extends NsisTarget {
}

protected generateGitHubInstallerName(): string {
return `${this.packager.appInfo.name}-WebSetup-${this.packager.appInfo.version}.exe`
const appInfo = this.packager.appInfo
const classifier = appInfo.name.toLowerCase() === appInfo.name ? "web-setup" : "WebSetup"
return `${appInfo.name}-${classifier}-${appInfo.version}.exe`
}
}
4 changes: 3 additions & 1 deletion packages/electron-builder/src/targets/nsis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ export default class NsisTarget extends Target {
}

protected generateGitHubInstallerName() {
return `${this.packager.appInfo.name}-${this.isPortable ? "" : "Setup-"}${this.packager.appInfo.version}.exe`
const appInfo = this.packager.appInfo
const classifier = appInfo.name.toLowerCase() === appInfo.name ? "setup-" : "Setup-"
return `${appInfo.name}-${this.isPortable ? "" : classifier}${appInfo.version}.exe`
}

private get isUnicodeEnabled() {
Expand Down
4 changes: 2 additions & 2 deletions test/out/windows/__snapshots__/installerTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Object {
"win": Array [
Object {
"file": "Test Custom Installation Dir Setup 1.1.0.exe",
"safeArtifactName": "test-custom-inst-dir-Setup-1.1.0.exe",
"safeArtifactName": "test-custom-inst-dir-setup-1.1.0.exe",
},
],
}
Expand All @@ -21,7 +21,7 @@ Object {

exports[`allowToChangeInstallationDirectory 3`] = `
Object {
"githubArtifactName": "test-custom-inst-dir-Setup-1.1.0.exe",
"githubArtifactName": "test-custom-inst-dir-setup-1.1.0.exe",
"path": "Test Custom Installation Dir Setup 1.1.0.exe",
"version": "1.1.0",
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Object {
"win": Array [
Object {
"file": "Test Menu Category CustomName 1.1.0.exe",
"safeArtifactName": "test-menu-category-Setup-1.1.0.exe",
"safeArtifactName": "test-menu-category-setup-1.1.0.exe",
},
],
}
Expand Down

0 comments on commit bfd6635

Please sign in to comment.