Add Windows installe and portable app

This commit is contained in:
2026-10-04 21:40:38 +03:00
parent c2b1c41393
commit 12e40aac6d
6 changed files with 3734 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
const { app, BrowserWindow, shell } = require('electron');
const path = require('node:path');
function createWindow() {
const window = new BrowserWindow({
width: 1440,
height: 920,
minWidth: 920,
minHeight: 680,
title: 'Daybreak Mail',
backgroundColor: '#f4f5f1',
autoHideMenuBar: true,
icon: path.join(__dirname, '..', 'icon.svg'),
webPreferences: {
contextIsolation: true,
nodeIntegration: false,
sandbox: true
}
});
window.loadFile(path.join(__dirname, '..', 'index.html'));
window.webContents.setWindowOpenHandler(({ url }) => {
if (url.startsWith('https://') || url.startsWith('mailto:')) shell.openExternal(url);
return { action: 'deny' };
});
window.webContents.on('will-navigate', event => event.preventDefault());
}
app.whenReady().then(() => {
app.setAppUserModelId('studio.daybreak.mail');
createWindow();
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow();
});
});
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit();
});