Skip to content

Commit 0ee226b

Browse files
committed
fix(nsis-web): connectivity issues with nsis-web
Close #2049
1 parent f12a090 commit 0ee226b

File tree

10 files changed

+960
-930
lines changed

10 files changed

+960
-930
lines changed

.idea/dictionaries/develar.xml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
"///": "All dependencies for all packages (hoisted)",
3131
"////": "All typings are added into root `package.json` to avoid duplication errors in the IDE compiler (several `node.d.ts` files).",
3232
"dependencies": {
33-
"7zip-bin": "~4.1.0",
33+
"7zip-bin": "~5.0.3",
3434
"@types/debug": "^4.1.4",
3535
"@types/is-ci": "^2.0.0",
3636
"@types/semver": "^6.0.1",
37-
"app-builder-bin": "3.3.1",
37+
"app-builder-bin": "3.4.0",
3838
"archiver": "^3.0.0",
3939
"async-exit-hook": "^2.0.1",
4040
"bluebird-lst": "^1.0.9",
@@ -67,7 +67,7 @@
6767
"temp-file": "^3.3.4",
6868
"tunnel-agent": "^0.6.0",
6969
"update-notifier": "^3.0.1",
70-
"yargs": "^13.2.4"
70+
"yargs": "^13.3.0"
7171
},
7272
"devDependencies": {
7373
"@babel/core": "^7.5.4",

packages/app-builder-lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"bugs": "https://github.com/electron-userland/electron-builder/issues",
4242
"homepage": "https://github.com/electron-userland/electron-builder",
4343
"dependencies": {
44-
"7zip-bin": "~4.1.0",
44+
"7zip-bin": "~5.0.1",
4545
"async-exit-hook": "^2.0.1",
4646
"bluebird-lst": "^1.0.9",
4747
"chromium-pickle-js": "^0.2.0",

packages/app-builder-lib/src/targets/nsis/NsisTarget.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import * as path from "path"
1212
import { Target } from "../../core"
1313
import { DesktopShortcutCreationPolicy, getEffectiveOptions } from "../../options/CommonWindowsInstallerConfiguration"
1414
import { computeSafeArtifactNameIfNeeded, normalizeExt } from "../../platformPackager"
15+
import { isMacOsCatalina } from "../../util/macosVersion"
1516
import { time } from "../../util/timer"
1617
import { execWine } from "../../wine"
1718
import { WinPackager } from "../../winPackager"
@@ -30,7 +31,7 @@ const debug = _debug("electron-builder:nsis")
3031
const ELECTRON_BUILDER_NS_UUID = UUID.parse("50e065bc-3134-11e6-9bab-38c9862bdaf3")
3132

3233
// noinspection SpellCheckingInspection
33-
const nsisResourcePathPromise = new Lazy(() => getBinFromUrl("nsis-resources", "3.3.0", "4okc98BD0v9xDcSjhPVhAkBMqos+FvD/5/H72fTTIwoHTuWd2WdD7r+1j72hxd+ZXxq1y3FRW0x6Z3jR0VfpMw=="))
34+
const nsisResourcePathPromise = new Lazy(() => getBinFromUrl("nsis-resources", "3.4.1", "Dqd6g+2buwwvoG1Vyf6BHR1b+25QMmPcwZx40atOT57gH27rkjOei1L0JTldxZu4NFoEmW4kJgZ3DlSWVON3+Q=="))
3435

3536
const USE_NSIS_BUILT_IN_COMPRESSOR = false
3637

@@ -320,7 +321,15 @@ export class NsisTarget extends Target {
320321
defines.BUILD_UNINSTALLER = null
321322
defines.UNINSTALLER_OUT_FILE = isWin ? uninstallerPath : path.win32.join("Z:", uninstallerPath)
322323
await this.executeMakensis(defines, commands, sharedHeader + await this.computeFinalScript(script, false))
323-
await execWine(installerPath)
324+
325+
// http://forums.winamp.com/showthread.php?p=3078545
326+
//
327+
if (await isMacOsCatalina()) {
328+
(await packager.vm.value).exec(installerPath, [])
329+
}
330+
else {
331+
await execWine(installerPath)
332+
}
324333
await packager.sign(uninstallerPath, " Signing NSIS uninstaller")
325334

326335
delete defines.BUILD_UNINSTALLER

packages/app-builder-lib/src/util/macosVersion.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,8 @@ export function isMacOsHighSierra(): boolean {
2929

3030
export async function isMacOsSierra() {
3131
return process.platform === "darwin" && await isOsVersionGreaterThanOrEqualTo("10.12.0")
32+
}
33+
34+
export function isMacOsCatalina() {
35+
return process.platform === "darwin" && semver.gte(osRelease(), "19.0.0")
3236
}

packages/app-builder-lib/templates/nsis/include/installer.nsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
StrCpy $isPackageFileExplicitlySpecified "true"
4141
${endIf}
4242

43-
# we do not check file hash is specifed explicitly using --package-file because it is clear that user definitly want to use this file and it is user responsibility to check
43+
# we do not check file hash is specifed explicitly using --package-file because it is clear that user definitely want to use this file and it is user responsibility to check
4444
# 1. auto-updater uses --package-file and validates checksum
4545
# 2. user can user another package file (use case - one installer suitable for any app version (use latest version))
4646
${if} ${FileExists} "$packageFile"

packages/app-builder-lib/templates/nsis/include/webPackage.nsh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,19 @@
2828
${endif}
2929

3030
download:
31-
inetc::get /USERAGENT "electron-builder (Mozilla)" /header "X-Arch: $packageArch" /RESUME "" "$packageUrl" "$PLUGINSDIR\package.7z" /END
31+
inetc::get /USERAGENT "electron-builder (Mozilla)" /HEADER "X-Arch: $packageArch" /RESUME "" "$packageUrl" "$PLUGINSDIR\package.7z" /END
3232
Pop $0
33+
34+
${if} $0 == "Cancelled"
35+
Quit
36+
${endif}
37+
38+
${if} $0 != "OK"
39+
# try without proxy
40+
inetc::get /NOPROXY /USERAGENT "electron-builder (Mozilla)" /HEADER "X-Arch: $packageArch" /RESUME "" "$packageUrl" "$PLUGINSDIR\package.7z" /END
41+
Pop $0
42+
${endif}
43+
3344
${if} $0 == "Cancelled"
3445
quit
3546
${elseif} $0 != "OK"

packages/builder-util/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"debug": "^4.1.1",
2222
"builder-util-runtime": "0.0.0-semantic-release",
2323
"source-map-support": "^0.5.12",
24-
"7zip-bin": "~4.1.0",
24+
"7zip-bin": "~5.0.1",
2525
"js-yaml": "^3.13.1",
2626
"@types/debug": "^4.1.4"
2727
},

packages/electron-builder/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"read-config-file": "4.0.1",
5555
"sanitize-filename": "^1.6.1",
5656
"update-notifier": "^3.0.1",
57-
"yargs": "^13.2.4",
57+
"yargs": "^13.3.0",
5858
"lazy-val": "^1.0.4",
5959
"app-builder-lib": "0.0.0-semantic-release",
6060
"dmg-builder": "0.0.0-semantic-release"

0 commit comments

Comments
 (0)