Skip to content

Commit 7532142

Browse files
committed
fix(windows): use build number env only if numeric
Close #2635
1 parent 0edb668 commit 7532142

File tree

7 files changed

+34
-27
lines changed

7 files changed

+34
-27
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@
3232
"app-builder-bin": "1.7.2",
3333
"archiver": "^2.1.1",
3434
"async-exit-hook": "^2.0.1",
35-
"aws-sdk": "^2.205.0",
35+
"aws-sdk": "^2.207.0",
3636
"bluebird-lst": "^1.0.5",
3737
"chalk": "^2.3.2",
3838
"chromium-pickle-js": "^0.2.0",
3939
"debug": "^3.1.0",
4040
"ejs": "^2.5.7",
4141
"electron-download-tf": "4.3.4",
4242
"electron-is-dev": "^0.3.0",
43-
"electron-osx-sign": "0.4.8",
43+
"electron-osx-sign": "0.4.10",
4444
"fs-extra-p": "^4.5.2",
4545
"gitbook-plugin-footer": "^0.0.6",
46-
"hosted-git-info": "^2.5.0",
46+
"hosted-git-info": "^2.6.0",
4747
"iconv-lite": "^0.4.19",
4848
"ini": "^1.3.5",
4949
"is-ci": "^1.1.0",
@@ -105,7 +105,7 @@
105105
"typescript": "2.7.2",
106106
"v8-compile-cache": "^1.1.2",
107107
"whitespace": "^2.1.0",
108-
"worker-farm": "^1.5.4"
108+
"worker-farm": "^1.6.0"
109109
},
110110
"jest": {
111111
"testEnvironment": "node",

packages/electron-builder-lib/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@
4848
"chromium-pickle-js": "^0.2.0",
4949
"builder-util-runtime": "0.0.0-semantic-release",
5050
"builder-util": "0.0.0-semantic-release",
51-
"electron-osx-sign": "0.4.8",
51+
"electron-osx-sign": "0.4.10",
5252
"electron-publish": "0.0.0-semantic-release",
5353
"fs-extra-p": "^4.5.2",
54-
"hosted-git-info": "^2.5.0",
54+
"hosted-git-info": "^2.6.0",
5555
"is-ci": "^1.1.0",
5656
"isbinaryfile": "^3.0.2",
5757
"js-yaml": "^3.11.0",

packages/electron-builder-lib/src/appInfo.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ export class AppInfo {
4343

4444
get versionInWeirdWindowsForm(): string {
4545
const parsedVersion = new SemVer(this.version)
46-
return `${parsedVersion.major}.${parsedVersion.minor}.${parsedVersion.patch}.${this.buildNumber || "0"}`
46+
// https://github.com/electron-userland/electron-builder/issues/2635#issuecomment-371792272
47+
let buildNumber = this.buildNumber
48+
if (buildNumber == null || !/^\d+$/.test(buildNumber)) {
49+
buildNumber = "0"
50+
}
51+
return `${parsedVersion.major}.${parsedVersion.minor}.${parsedVersion.patch}.${buildNumber}`
4752
}
4853

4954
private get notNullDevMetadata() {

packages/electron-publisher-s3/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
],
1313
"dependencies": {
1414
"fs-extra-p": "^4.5.2",
15-
"aws-sdk": "^2.205.0",
15+
"aws-sdk": "^2.207.0",
1616
"mime": "^2.2.0",
1717
"electron-publish": "~0.0.0-semantic-release",
1818
"builder-util": "^0.0.0-semantic-release",

test/src/windows/oneClickInstallerTest.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import BluebirdPromise from "bluebird-lst"
21
import { Arch, Platform } from "electron-builder"
32
import { writeFile } from "fs-extra-p"
43
import * as path from "path"
@@ -41,7 +40,7 @@ test.ifAll.ifNotCiMac("multi language license", app({
4140
},
4241
}, {
4342
projectDirCreated: projectDir => {
44-
return BluebirdPromise.all([
43+
return Promise.all([
4544
writeFile(path.join(projectDir, "build", "license_en.txt"), "Hi"),
4645
writeFile(path.join(projectDir, "build", "license_ru.txt"), "Привет"),
4746
writeFile(path.join(projectDir, "build", "license_ko.txt"), "Привет"),
@@ -61,7 +60,7 @@ test.ifAll.ifNotCiMac("html license", app({
6160
},
6261
}, {
6362
projectDirCreated: projectDir => {
64-
return BluebirdPromise.all([
63+
return Promise.all([
6564
writeFile(path.join(projectDir, "build", "license.html"), '<html><body><p>Hi <a href="https://google.com" target="_blank">google</a></p></body></html>'),
6665
])
6766
},
@@ -93,7 +92,7 @@ test.ifDevOrLinuxCi("perMachine, no run after finish", app({
9392
},
9493
}, {
9594
projectDirCreated: projectDir => {
96-
return BluebirdPromise.all([
95+
return Promise.all([
9796
copyTestAsset("headerIcon.ico", path.join(projectDir, "build", "foo test space.ico")),
9897
copyTestAsset("license.txt", path.join(projectDir, "build", "license.txt")),
9998
])
@@ -117,15 +116,15 @@ test.ifNotCiMac("installerHeaderIcon", () => {
117116
}, {
118117
projectDirCreated: projectDir => {
119118
headerIconPath = path.join(projectDir, "build", "installerHeaderIcon.ico")
120-
return BluebirdPromise.all([copyTestAsset("headerIcon.ico", headerIconPath), copyTestAsset("headerIcon.ico", path.join(projectDir, "build", "uninstallerIcon.ico"))])
119+
return Promise.all([copyTestAsset("headerIcon.ico", headerIconPath), copyTestAsset("headerIcon.ico", path.join(projectDir, "build", "uninstallerIcon.ico"))])
121120
}
122121
}
123122
)
124123
})
125124

126125
test.ifDevOrLinuxCi("custom include", () => assertPack("test-app-one", {targets: nsisTarget}, {
127126
projectDirCreated: projectDir => copyTestAsset("installer.nsh", path.join(projectDir, "build", "installer.nsh")),
128-
packed: context => BluebirdPromise.all([
127+
packed: context => Promise.all([
129128
assertThat(path.join(context.projectDir, "build", "customHeader")).isFile(),
130129
assertThat(path.join(context.projectDir, "build", "customInit")).isFile(),
131130
assertThat(path.join(context.projectDir, "build", "customInstall")).isFile(),

test/src/windows/portableTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test.ifAll.ifNotCiMac("portable", app({
1313
}
1414
}))
1515

16-
test.ifAll.ifWinCi("portable zip", app({
16+
test.ifAll.ifDevOrWinCi("portable zip", app({
1717
targets: Platform.WINDOWS.createTarget("portable"),
1818
config: {
1919
publish: null,

yarn.lock

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,9 @@ atob@^2.0.0:
484484
version "2.0.3"
485485
resolved "https://registry.yarnpkg.com/atob/-/atob-2.0.3.tgz#19c7a760473774468f20b2d2d03372ad7d4cbf5d"
486486

487-
aws-sdk@^2.205.0:
488-
version "2.205.0"
489-
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.205.0.tgz#1a93730253e2be027a4bd3af9248cbda0573de80"
487+
aws-sdk@^2.207.0:
488+
version "2.207.0"
489+
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.207.0.tgz#c0a30977d8d2788301850b265ff05eb7c9fdf7f2"
490490
dependencies:
491491
buffer "4.9.1"
492492
events "^1.1.1"
@@ -1690,9 +1690,9 @@ electron-is-dev@^0.3.0:
16901690
version "0.3.0"
16911691
resolved "https://registry.yarnpkg.com/electron-is-dev/-/electron-is-dev-0.3.0.tgz#14e6fda5c68e9e4ecbeff9ccf037cbd7c05c5afe"
16921692

1693-
electron-osx-sign@0.4.8:
1694-
version "0.4.8"
1695-
resolved "https://registry.yarnpkg.com/electron-osx-sign/-/electron-osx-sign-0.4.8.tgz#f0b9fadded9e1e54ec35fa89877b5c6c34c7bc40"
1693+
electron-osx-sign@0.4.10:
1694+
version "0.4.10"
1695+
resolved "https://registry.yarnpkg.com/electron-osx-sign/-/electron-osx-sign-0.4.10.tgz#be4f3b89b2a75a1dc5f1e7249081ab2929ca3a26"
16961696
dependencies:
16971697
bluebird "^3.5.0"
16981698
compare-version "^0.1.2"
@@ -2505,10 +2505,14 @@ home-or-tmp@^2.0.0:
25052505
os-homedir "^1.0.0"
25062506
os-tmpdir "^1.0.1"
25072507

2508-
hosted-git-info@^2.1.4, hosted-git-info@^2.5.0:
2508+
hosted-git-info@^2.1.4:
25092509
version "2.5.0"
25102510
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c"
25112511

2512+
hosted-git-info@^2.6.0:
2513+
version "2.6.0"
2514+
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.6.0.tgz#23235b29ab230c576aab0d4f13fc046b0b038222"
2515+
25122516
html-encoding-sniffer@^1.0.2:
25132517
version "1.0.2"
25142518
resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8"
@@ -5796,12 +5800,11 @@ wordwrapjs@^3.0.0:
57965800
reduce-flatten "^1.0.1"
57975801
typical "^2.6.1"
57985802

5799-
worker-farm@^1.5.4:
5800-
version "1.5.4"
5801-
resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.5.4.tgz#4debbe46b40edefcc717ebde74a90b1ae1e909a1"
5803+
worker-farm@^1.6.0:
5804+
version "1.6.0"
5805+
resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.6.0.tgz#aecc405976fab5a95526180846f0dba288f3a4a0"
58025806
dependencies:
58035807
errno "~0.1.7"
5804-
xtend "~4.0.1"
58055808

58065809
wrap-ansi@^2.0.0:
58075810
version "2.1.0"
@@ -5874,7 +5877,7 @@ xmlhttprequest@~1.7.0:
58745877
version "1.7.0"
58755878
resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.7.0.tgz#dc697a8df0258afacad526c1c296b1bdd12c4ab3"
58765879

5877-
"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@~4.0.0, xtend@~4.0.1:
5880+
"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@~4.0.0:
58785881
version "4.0.1"
58795882
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
58805883

0 commit comments

Comments
 (0)