Skip to content

Commit

Permalink
fix(nsis-web): connectivity issues with nsis-web
Browse files Browse the repository at this point in the history
Close #2049
  • Loading branch information
develar committed Jul 17, 2019
1 parent f12a090 commit 0ee226b
Show file tree
Hide file tree
Showing 10 changed files with 960 additions and 930 deletions.
2 changes: 2 additions & 0 deletions .idea/dictionaries/develar.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
"///": "All dependencies for all packages (hoisted)",
"////": "All typings are added into root `package.json` to avoid duplication errors in the IDE compiler (several `node.d.ts` files).",
"dependencies": {
"7zip-bin": "~4.1.0",
"7zip-bin": "~5.0.3",
"@types/debug": "^4.1.4",
"@types/is-ci": "^2.0.0",
"@types/semver": "^6.0.1",
"app-builder-bin": "3.3.1",
"app-builder-bin": "3.4.0",
"archiver": "^3.0.0",
"async-exit-hook": "^2.0.1",
"bluebird-lst": "^1.0.9",
Expand Down Expand Up @@ -67,7 +67,7 @@
"temp-file": "^3.3.4",
"tunnel-agent": "^0.6.0",
"update-notifier": "^3.0.1",
"yargs": "^13.2.4"
"yargs": "^13.3.0"
},
"devDependencies": {
"@babel/core": "^7.5.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/app-builder-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"bugs": "https://github.com/electron-userland/electron-builder/issues",
"homepage": "https://github.com/electron-userland/electron-builder",
"dependencies": {
"7zip-bin": "~4.1.0",
"7zip-bin": "~5.0.1",
"async-exit-hook": "^2.0.1",
"bluebird-lst": "^1.0.9",
"chromium-pickle-js": "^0.2.0",
Expand Down
13 changes: 11 additions & 2 deletions packages/app-builder-lib/src/targets/nsis/NsisTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import * as path from "path"
import { Target } from "../../core"
import { DesktopShortcutCreationPolicy, getEffectiveOptions } from "../../options/CommonWindowsInstallerConfiguration"
import { computeSafeArtifactNameIfNeeded, normalizeExt } from "../../platformPackager"
import { isMacOsCatalina } from "../../util/macosVersion"
import { time } from "../../util/timer"
import { execWine } from "../../wine"
import { WinPackager } from "../../winPackager"
Expand All @@ -30,7 +31,7 @@ const debug = _debug("electron-builder:nsis")
const ELECTRON_BUILDER_NS_UUID = UUID.parse("50e065bc-3134-11e6-9bab-38c9862bdaf3")

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

const USE_NSIS_BUILT_IN_COMPRESSOR = false

Expand Down Expand Up @@ -320,7 +321,15 @@ export class NsisTarget extends Target {
defines.BUILD_UNINSTALLER = null
defines.UNINSTALLER_OUT_FILE = isWin ? uninstallerPath : path.win32.join("Z:", uninstallerPath)
await this.executeMakensis(defines, commands, sharedHeader + await this.computeFinalScript(script, false))
await execWine(installerPath)

// http://forums.winamp.com/showthread.php?p=3078545
//
if (await isMacOsCatalina()) {
(await packager.vm.value).exec(installerPath, [])
}
else {
await execWine(installerPath)
}
await packager.sign(uninstallerPath, " Signing NSIS uninstaller")

delete defines.BUILD_UNINSTALLER
Expand Down
4 changes: 4 additions & 0 deletions packages/app-builder-lib/src/util/macosVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@ export function isMacOsHighSierra(): boolean {

export async function isMacOsSierra() {
return process.platform === "darwin" && await isOsVersionGreaterThanOrEqualTo("10.12.0")
}

export function isMacOsCatalina() {
return process.platform === "darwin" && semver.gte(osRelease(), "19.0.0")
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
StrCpy $isPackageFileExplicitlySpecified "true"
${endIf}

# 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
# 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
# 1. auto-updater uses --package-file and validates checksum
# 2. user can user another package file (use case - one installer suitable for any app version (use latest version))
${if} ${FileExists} "$packageFile"
Expand Down
13 changes: 12 additions & 1 deletion packages/app-builder-lib/templates/nsis/include/webPackage.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,19 @@
${endif}

download:
inetc::get /USERAGENT "electron-builder (Mozilla)" /header "X-Arch: $packageArch" /RESUME "" "$packageUrl" "$PLUGINSDIR\package.7z" /END
inetc::get /USERAGENT "electron-builder (Mozilla)" /HEADER "X-Arch: $packageArch" /RESUME "" "$packageUrl" "$PLUGINSDIR\package.7z" /END
Pop $0

${if} $0 == "Cancelled"
Quit
${endif}

${if} $0 != "OK"
# try without proxy
inetc::get /NOPROXY /USERAGENT "electron-builder (Mozilla)" /HEADER "X-Arch: $packageArch" /RESUME "" "$packageUrl" "$PLUGINSDIR\package.7z" /END
Pop $0
${endif}

${if} $0 == "Cancelled"
quit
${elseif} $0 != "OK"
Expand Down
2 changes: 1 addition & 1 deletion packages/builder-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"debug": "^4.1.1",
"builder-util-runtime": "0.0.0-semantic-release",
"source-map-support": "^0.5.12",
"7zip-bin": "~4.1.0",
"7zip-bin": "~5.0.1",
"js-yaml": "^3.13.1",
"@types/debug": "^4.1.4"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"read-config-file": "4.0.1",
"sanitize-filename": "^1.6.1",
"update-notifier": "^3.0.1",
"yargs": "^13.2.4",
"yargs": "^13.3.0",
"lazy-val": "^1.0.4",
"app-builder-lib": "0.0.0-semantic-release",
"dmg-builder": "0.0.0-semantic-release"
Expand Down
Loading

0 comments on commit 0ee226b

Please sign in to comment.