开机自启的主要代码
在主进程文件中写入如下代码:
// 获取可执行文件位置
const ex = process.execPath
app.setLoginItemSettings({
openAtLogin: true,
path: ex,
args: [],
})
在主进程文件中写入如下代码:
// 获取可执行文件位置
const ex = process.execPath
app.setLoginItemSettings({
openAtLogin: true,
path: ex,
args: [],
})