build(electron): app now builds and runs on macOS as a standalone app

This commit is contained in:
2025-08-10 15:09:23 -04:00
parent 7cfc70632b
commit 63bc3a198d
7 changed files with 139 additions and 14 deletions

View File

@@ -6,10 +6,16 @@ const { spawn } = require('child_process');
function runPythonCommand(command, kwargs, event) {
const buildDir = path.resolve(__dirname, '..', '..', 'build');
let backendPath;
// Determine executable name based on platform
const executableName = process.platform === 'win32' ? 'fourdst-backend.exe' : 'fourdst-backend';
if (app.isPackaged) {
backendPath = path.join(process.resourcesPath, 'fourdst-backend');
// In packaged app, backend is in resources/backend/ directory
backendPath = path.join(process.resourcesPath, 'backend', executableName);
} else {
backendPath = path.join(buildDir, 'electron', 'dist', 'fourdst-backend', 'fourdst-backend');
// In development, use the meson build output
backendPath = path.join(buildDir, 'electron', 'dist', 'fourdst-backend', executableName);
}
console.log(`[MAIN_PROCESS] Spawning backend: ${backendPath}`);