From e5682a0a9e005f6b29177c32263793014169b7b6 Mon Sep 17 00:00:00 2001 From: develar Date: Wed, 15 Mar 2017 07:41:58 +0100 Subject: [PATCH] feat(nsis): do not prompt user to close app before installing on update Close #1368 --- package.json | 2 +- .../nsis/allowOnlyOneInstallerInstance.nsh | 15 ++++++++----- test/src/ExtraBuildTest.ts | 2 +- yarn.lock | 22 +++++++------------ 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index da6fde8717d..0b8d94fb940 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "sanitize-filename": "^1.6.1", "semver": "^5.3.0", "stat-mode": "^0.2.2", - "ts-jsdoc": "^1.0.7", + "ts-jsdoc": "^1.1.0", "tunnel-agent": "^0.6.0", "update-notifier": "^2.1.0", "uuid-1345": "^0.99.6", diff --git a/packages/electron-builder/templates/nsis/allowOnlyOneInstallerInstance.nsh b/packages/electron-builder/templates/nsis/allowOnlyOneInstallerInstance.nsh index 333918743dd..09f2fe2e40d 100644 --- a/packages/electron-builder/templates/nsis/allowOnlyOneInstallerInstance.nsh +++ b/packages/electron-builder/templates/nsis/allowOnlyOneInstallerInstance.nsh @@ -28,13 +28,16 @@ ${if} $3 != "${APP_EXECUTABLE_FILENAME}" ${nsProcess::FindProcess} "${APP_EXECUTABLE_FILENAME}" $R0 ${If} $R0 == 0 + ${if} ${Updated} + Goto doStopProcess + ${endif} MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "${PRODUCT_NAME} is running. $\r$\nClick OK to close it and continue with ${MODE}." /SD IDOK IDOK doStopProcess - Quit - doStopProcess: - DetailPrint "Closing running ${PRODUCT_NAME} ..." - ${nsProcess::KillProcess} "${APP_EXECUTABLE_FILENAME}" $R0 - DetailPrint "Waiting for ${PRODUCT_NAME} to close." - Sleep 2000 + Quit + doStopProcess: + DetailPrint "Closing running ${PRODUCT_NAME} ..." + ${nsProcess::KillProcess} "${APP_EXECUTABLE_FILENAME}" $R0 + DetailPrint "Waiting for ${PRODUCT_NAME} to close." + Sleep 2000 ${EndIf} ${nsProcess::Unload} ${endIf} diff --git a/test/src/ExtraBuildTest.ts b/test/src/ExtraBuildTest.ts index f244f363c7e..7cf442bcb37 100644 --- a/test/src/ExtraBuildTest.ts +++ b/test/src/ExtraBuildTest.ts @@ -54,7 +54,7 @@ test.ifAll.ifLinuxOrDevMac("prepackaged", app({ } })) -test.ifAll.ifDevOrWinCi("override targets in the config", app({ +test.ifAll.ifDevOrLinuxCi("override targets in the config", app({ targets: linuxDirTarget, }, { packed: async (context) => { diff --git a/yarn.lock b/yarn.lock index aac00bbfce4..cecdd7e9271 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1079,10 +1079,10 @@ electron-macos-sign@~1.6.0: plist "^2.0.1" end-of-stream@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.2.0.tgz#bce82685eab6262e2a780ae740e6334027c01622" + version "1.4.0" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.0.tgz#7a90d833efda6cfa6eac0f4949dbb0fad3a63206" dependencies: - once "~1.3.0" + once "^1.4.0" entities@~1.1.1: version "1.1.1" @@ -2412,12 +2412,6 @@ once@^1.3.0, once@^1.4.0: dependencies: wrappy "1" -once@~1.3.0: - version "1.3.3" - resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" - dependencies: - wrappy "1" - optimist@^0.6.1, optimist@~0.6.0: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" @@ -2673,8 +2667,8 @@ readable-stream@^1.1.8, readable-stream@~1.1.9: string_decoder "~0.10.x" readable-stream@^2.0.0, readable-stream@^2.0.5: - version "2.2.3" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.3.tgz#9cf49463985df016c8ae8813097a9293a9b33729" + version "2.2.5" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.5.tgz#a0b187304e05bab01a4ce2b4cc9c607d5aa1d606" dependencies: buffer-shims "^1.0.0" core-util-is "~1.0.0" @@ -3196,9 +3190,9 @@ ts-babel@^2.0.0: markdown-it "^8.3.1" source-map-support "^0.4.11" -ts-jsdoc@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/ts-jsdoc/-/ts-jsdoc-1.0.7.tgz#69e05f4aabc18afc9a053737b788d3395473fca6" +ts-jsdoc@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/ts-jsdoc/-/ts-jsdoc-1.1.0.tgz#7154f08c4740adaa5cf69c2fcdfa7ba9f187a1b7" dependencies: bluebird-lst "^1.0.1" chalk "^1.1.3"