feat(install): added basis install process

Now it is able to install apps from the render process and properly display logs on the app detial page.
This commit is contained in:
Elysia
2026-01-25 22:30:39 +08:00
parent 22435a5e1b
commit 50fb1a0065
15 changed files with 318 additions and 69 deletions

View File

@@ -1,16 +1,16 @@
import { app, BrowserWindow, shell, ipcMain, dialog } from 'electron'
import { app, BrowserWindow, shell } from 'electron'
import { createRequire } from 'node:module'
import { fileURLToPath } from 'node:url'
import path from 'node:path'
import os from 'node:os'
import './handle-url-scheme.js'
// Assure single instance application
if (!app.requestSingleInstanceLock()) {
app.exit(0);
}
import './handle-url-scheme.js'
import './backend/download-manager.js'
const require = createRequire(import.meta.url)
const __dirname = path.dirname(fileURLToPath(import.meta.url))
@@ -111,18 +111,18 @@ app.on('activate', () => {
})
// New window example arg: new windows url
ipcMain.handle('open-win', (_, arg) => {
const childWindow = new BrowserWindow({
webPreferences: {
preload,
nodeIntegration: true,
contextIsolation: false,
},
})
// ipcMain.handle('open-win', (_, arg) => {
// const childWindow = new BrowserWindow({
// webPreferences: {
// preload,
// nodeIntegration: true,
// contextIsolation: false,
// },
// })
if (VITE_DEV_SERVER_URL) {
childWindow.loadURL(`${VITE_DEV_SERVER_URL}#${arg}`)
} else {
childWindow.loadFile(indexHtml, { hash: arg })
}
})
// if (VITE_DEV_SERVER_URL) {
// childWindow.loadURL(`${VITE_DEV_SERVER_URL}#${arg}`)
// } else {
// childWindow.loadFile(indexHtml, { hash: arg })
// }
// })