mirror of
https://github.com/fanchenio/DawnLauncher.git
synced 2025-07-14 13:22:09 +08:00
fix the problem that sometimes the startup fails when booting.
This commit is contained in:
parent
4048f4a230
commit
df499a0517
@ -1,6 +1,6 @@
|
|||||||
import { app, BrowserWindow, dialog } from "electron";
|
import { app, BrowserWindow, dialog } from "electron";
|
||||||
import { release } from "node:os";
|
import { release } from "node:os";
|
||||||
import { join, dirname } from "node:path";
|
import { join, dirname, basename } from "node:path";
|
||||||
import indexIpcEvent from "./main/ipcEvent";
|
import indexIpcEvent from "./main/ipcEvent";
|
||||||
import classificationIpcEvent from "./classification/ipcEvent";
|
import classificationIpcEvent from "./classification/ipcEvent";
|
||||||
import { init as classificationDataInit } from "./classification/data";
|
import { init as classificationDataInit } from "./classification/data";
|
||||||
@ -105,6 +105,16 @@ app.whenReady().then(() => {
|
|||||||
}
|
}
|
||||||
// 设置快捷键
|
// 设置快捷键
|
||||||
setShortcutKey();
|
setShortcutKey();
|
||||||
|
// 每次开启软件时都设置一次开机启动选项
|
||||||
|
if (process.env.NODE_ENV !== "development") {
|
||||||
|
const exeName = basename(process.execPath);
|
||||||
|
app.setLoginItemSettings({
|
||||||
|
openAtLogin: global.setting.general.startup,
|
||||||
|
openAsHidden: false,
|
||||||
|
path: process.execPath,
|
||||||
|
args: ["--processStart", `"${exeName}"`],
|
||||||
|
});
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (process.env.NODE_ENV === "development") {
|
if (process.env.NODE_ENV === "development") {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
Loading…
Reference in New Issue
Block a user