mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-26 01:10:16 +08:00
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:
@@ -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 })
|
||||
// }
|
||||
// })
|
||||
|
||||
Reference in New Issue
Block a user