cocktailpeanut преди 4 месеца
родител
ревизия
0c1e9c3c6b
променени са 4 файла, в които са добавени 193 реда и са изтрити 236 реда
  1. 4 0
      build/installer.nsh
  2. 12 3
      main.js
  3. 172 230
      package-lock.json
  4. 5 3
      package.json

+ 4 - 0
build/installer.nsh

@@ -0,0 +1,4 @@
+# https://github.com/electron-userland/electron-builder/issues/6865#issuecomment-1871121350
+!macro customInit
+  Delete "$INSTDIR\Uninstall*.exe"
+!macroend

+ 12 - 3
main.js

@@ -90,10 +90,9 @@ const attach = (event, webContents) => {
       //  - if it's a remote host, open in external browser
       webContents.opened = true
     } else {
-      console.log("will-navigate", { event, url })
+//      console.log("will-navigate", { event, url })
       let host = new URL(url).host
       let localhost = new URL(root_url).host
-      console.log({ host, localhost })
       if (host !== localhost) {
         event.preventDefault()
         shell.openExternal(url);
@@ -590,7 +589,17 @@ document.querySelector("form").addEventListener("submit", (e) => {
       if (BrowserWindow.getAllWindows().length === 0) createWindow(PORT)
     })
     app.on('window-all-closed', function () {
-      if (process.platform !== 'darwin') app.quit()
+      console.log("window-all-closed")
+      if (process.platform !== 'darwin') {
+        // Reset all shells before quitting
+        pinokiod.kernel.shell.reset()
+        // wait 1 second before quitting the app
+        // otherwise the app.quit() fails because the subprocesses are running
+        setTimeout(() => {
+          console.log("app.quit()")
+          app.quit()
+        }, 1000)
+      }
     })
     app.on('browser-window-created', (event, win) => {
       if (win.type !== "splash") {

Файловите разлики са ограничени, защото са твърде много
+ 172 - 230
package-lock.json


+ 5 - 3
package.json

@@ -1,6 +1,6 @@
 {
   "name": "Pinokio",
-  "version": "2.1.14",
+  "version": "3.0.26",
   "homepage": "https://pinokio.computer",
   "description": "pinokio",
   "main": "main.js",
@@ -17,10 +17,12 @@
   "build": {
     "appId": "computer.pinokio",
     "asarUnpack": [
+      "node_modules/go-get-folder-size/**/*",
       "node_modules/7zip-bin/**/*",
       "node_modules/sweetalert2/**/*",
-      "node_modules/node-pty-prebuilt-multiarch-cp/**/*"
+      "node_modules/@cocktailpeanut/**/*"
     ],
+    "nsis": { "include": "build/installer.nsh" },
     "extraResources": [
       "./script/**"
     ],
@@ -106,7 +108,7 @@
   "dependencies": {
     "electron-store": "^8.1.0",
     "electron-window-state": "^5.0.3",
-    "pinokiod": "^2.1.14"
+    "pinokiod": "^3.0.26"
   },
   "devDependencies": {
     "@electron/rebuild": "3.2.10",

Някои файлове не бяха показани, защото твърде много файлове са промени