Fix auto-launch in development mode
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
3b5ef59c32
commit
379652e22d
1 changed files with 6 additions and 2 deletions
8
main.js
8
main.js
|
|
@ -774,9 +774,11 @@ ipcMain.handle('set-app-settings', (event, settings) => {
|
||||||
|
|
||||||
// Apply auto-launch setting
|
// Apply auto-launch setting
|
||||||
if (settings.hasOwnProperty('startOnBoot')) {
|
if (settings.hasOwnProperty('startOnBoot')) {
|
||||||
|
const isDev = !app.isPackaged;
|
||||||
app.setLoginItemSettings({
|
app.setLoginItemSettings({
|
||||||
openAtLogin: settings.startOnBoot,
|
openAtLogin: settings.startOnBoot,
|
||||||
path: process.execPath
|
path: process.execPath,
|
||||||
|
args: isDev ? [app.getAppPath()] : []
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -820,9 +822,11 @@ app.whenReady().then(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set auto-launch
|
// Set auto-launch
|
||||||
|
const isDev = !app.isPackaged;
|
||||||
app.setLoginItemSettings({
|
app.setLoginItemSettings({
|
||||||
openAtLogin: appSettings.startOnBoot,
|
openAtLogin: appSettings.startOnBoot,
|
||||||
path: process.execPath
|
path: process.execPath,
|
||||||
|
args: isDev ? [app.getAppPath()] : []
|
||||||
});
|
});
|
||||||
|
|
||||||
createMainWindow();
|
createMainWindow();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue