diff --git a/src/index.ts b/src/index.ts index 8e2a289..6df5d7c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,6 +5,15 @@ import { AccountManager } from "./mail/AccountManager"; export let accountManager: AccountManager | null = null; +if (app.isPackaged) { + const ex = process.execPath; + app.setLoginItemSettings({ + openAtLogin: true, + path: ex, + args: [], + }); +} + if (require("electron-squirrel-startup")) { app.quit(); } diff --git a/src/mail/AccountManager.ts b/src/mail/AccountManager.ts index ab26f32..cc65cf6 100644 --- a/src/mail/AccountManager.ts +++ b/src/mail/AccountManager.ts @@ -8,7 +8,7 @@ export class AccountManager { // registered accounts list private accounts: MailService[] = []; // path to store account information - private readonly configPath = path.join(__dirname, "../../config/mails"); + private readonly configPath = path.join(__dirname, "../config/mails"); constructor() { // create config path if not exists