Skip to content

Commit

Permalink
Windows: Fixes #11508: Prevent installer from recognizing itself as a…
Browse files Browse the repository at this point in the history
… running instance of Joplin and switch back to electron-builder v24 (#11541)
  • Loading branch information
personalizedrefrigerator authored Dec 19, 2024
1 parent 28ff17a commit d9df2dc
Show file tree
Hide file tree
Showing 5 changed files with 226 additions and 272 deletions.
15 changes: 15 additions & 0 deletions .yarn/patches/app-builder-lib-npm-24.13.3-86a66c0bf3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This patch prevents the installer from considering itself as a running instance of Joplin.
# See https://github.com/laurent22/joplin/pull/11541
diff --git a/templates/nsis/include/allowOnlyOneInstallerInstance.nsh b/templates/nsis/include/allowOnlyOneInstallerInstance.nsh
index fe5d45c730f36c9fe8d8cfea12e242e501b67139..af2ce5c90ac910b079e24992519bffe33d57668a 100644
--- a/templates/nsis/include/allowOnlyOneInstallerInstance.nsh
+++ b/templates/nsis/include/allowOnlyOneInstallerInstance.nsh
@@ -42,7 +42,7 @@
${nsProcess::FindProcess} "${_FILE}" ${_ERR}
!else
# find process owned by current user
- nsExec::Exec `%SYSTEMROOT%\System32\cmd.exe /c tasklist /FI "USERNAME eq %USERNAME%" /FI "IMAGENAME eq ${_FILE}" /FO csv | %SYSTEMROOT%\System32\find.exe "${_FILE}"`
+ nsExec::Exec `%SYSTEMROOT%\System32\cmd.exe /c tasklist /FI "USERNAME eq %USERNAME%" /FI "PID ne $pid" /FI "IMAGENAME eq ${_FILE}" /FO csv | %SYSTEMROOT%\System32\find.exe "${_FILE}"`
Pop ${_ERR}
!endif
!macroend
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
},
"husky": {
"hooks": {
"pre-commit": "yarn lint-staged"
"pre-commit": "corepack yarn lint-staged"
}
},
"devDependencies": {
Expand Down Expand Up @@ -105,12 +105,15 @@
"[email protected]": "patch:react-native-camera@npm%3A4.2.1#./.yarn/patches/react-native-camera-npm-4.2.1-24b2600a7e.patch",
"[email protected]": "patch:react-native-vosk@npm%3A0.1.12#./.yarn/patches/react-native-vosk-npm-0.1.12-76b1caaae8.patch",
"eslint": "patch:[email protected]#./.yarn/patches/eslint-npm-8.39.0-d92bace04d.patch",
"[email protected]": "patch:app-builder-lib@npm%3A24.4.0#./.yarn/patches/app-builder-lib-npm-24.4.0-05322ff057.patch",
"nanoid": "patch:nanoid@npm%3A3.3.7#./.yarn/patches/nanoid-npm-3.3.7-98824ba130.patch",
"pdfjs-dist": "patch:pdfjs-dist@npm%3A3.11.174#./.yarn/patches/pdfjs-dist-npm-3.11.174-67f2fee6d6.patch",
"@react-native-community/slider": "patch:@react-native-community/slider@npm%3A4.4.4#./.yarn/patches/@react-native-community-slider-npm-4.4.4-d78e472f48.patch",
"husky": "patch:husky@npm%3A3.1.0#./.yarn/patches/husky-npm-3.1.0-5cc13e4e34.patch",
"chokidar@^2.0.0": "3.5.3",
"[email protected]": "patch:react-native@npm%3A0.74.1#./.yarn/patches/react-native-npm-0.74.1-754c02ae9e.patch",
"[email protected]": "patch:rn-fetch-blob@npm%3A0.12.0#./.yarn/patches/rn-fetch-blob-npm-0.12.0-cf02e3c544.patch"
"[email protected]": "patch:rn-fetch-blob@npm%3A0.12.0#./.yarn/patches/rn-fetch-blob-npm-0.12.0-cf02e3c544.patch",
"[email protected]": "patch:app-builder-lib@npm%3A26.0.0-alpha.7#./.yarn/patches/app-builder-lib-npm-26.0.0-alpha.7-e1b3dca119.patch",
"[email protected]": "patch:app-builder-lib@npm%3A24.13.3#./.yarn/patches/app-builder-lib-npm-24.13.3-86a66c0bf3.patch"
}
}
10 changes: 4 additions & 6 deletions packages/app-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,8 @@
"icon": "../../Assets/LinuxIcons",
"category": "Office",
"desktop": {
"entry": {
"Icon": "joplin",
"MimeType": "x-scheme-handler/joplin;"
}
"Icon": "joplin",
"MimeType": "x-scheme-handler/joplin;"
},
"target": [
"AppImage",
Expand All @@ -133,7 +131,7 @@
"devDependencies": {
"7zip-bin": "5.2.0",
"@axe-core/playwright": "4.10.0",
"@electron/rebuild": "3.7.1",
"@electron/rebuild": "3.6.0",
"@joplin/default-plugins": "~3.2",
"@joplin/tools": "~3.2",
"@playwright/test": "1.45.3",
Expand All @@ -147,7 +145,7 @@
"@types/tesseract.js": "2.0.0",
"axios": "^1.7.7",
"electron": "32.2.0",
"electron-builder": "26.0.0-alpha.7",
"electron-builder": "24.13.3",
"glob": "10.4.5",
"gulp": "4.0.2",
"jest": "29.7.0",
Expand Down
1 change: 1 addition & 0 deletions packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@types/node-rsa": "1.1.4",
"@types/react": "18.3.3",
"@types/uuid": "9.0.7",
"canvas": "2.11.2",
"clean-html": "1.5.0",
"jest": "29.7.0",
"jsdom": "23.2.0",
Expand Down
Loading

0 comments on commit d9df2dc

Please sign in to comment.