This commit is contained in:
cocktailpeanut 2024-12-17 08:47:45 -05:00
parent 5b99135940
commit 0c1e9c3c6b
4 changed files with 219 additions and 311 deletions

4
build/installer.nsh Normal file
View File

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

15
main.js
View File

@ -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") {

503
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -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",