diff --git a/electron/main/install-deps.ts b/electron/main/install-deps.ts index cb10b8c9f..7156b1c1f 100644 --- a/electron/main/install-deps.ts +++ b/electron/main/install-deps.ts @@ -677,116 +677,4 @@ export async function installDependencies(version: string): Promise - msg.includes(pattern) && !msg.includes("Uvicorn running on") - )) { - dependencyInstallationDetected = true; - log.info('[BACKEND STARTUP] UV dependency installation detected during uvicorn startup'); - - // Create installing lock file to maintain consistency with install-deps.ts - InstallLogs.setLockPath(); - log.info('[BACKEND STARTUP] Created uv_installing.lock file'); - - // Notify frontend that installation has started (only once) - if (!installationNotificationSent) { - installationNotificationSent = true; - const notificationSent = safeMainWindowSend('install-dependencies-start'); - if (notificationSent) { - log.info('[BACKEND STARTUP] Notified frontend of dependency installation start'); - } else { - log.warn('[BACKEND STARTUP] Failed to notify frontend of dependency installation start'); - } - } - } - - // Send installation logs to frontend if installation was detected - if (dependencyInstallationDetected && !msg.includes("Uvicorn running on")) { - safeMainWindowSend('install-dependencies-log', { - type: msg.toLowerCase().includes("error") || msg.toLowerCase().includes("traceback") ? 'stderr' : 'stdout', - data: msg - }); - } - - // Check if installation is complete (uvicorn starts successfully) - if (dependencyInstallationDetected && msg.includes("Uvicorn running on")) { - log.info('[BACKEND STARTUP] UV dependency installation completed, uvicorn started successfully'); - - // Clean up installing lock and create installed lock - InstallLogs.cleanLockPath(); - fs.writeFileSync(installedLockPath, ''); - log.info('[BACKEND STARTUP] Created uv_installed.lock file'); - - safeMainWindowSend('install-dependencies-complete', { - success: true, - message: 'Dependencies installed successfully during backend startup' - }); - } - - // Handle installation failures - if (dependencyInstallationDetected && ( - msg.toLowerCase().includes("failed to resolve dependencies") || - msg.toLowerCase().includes("installation failed") || - msg.includes("× No solution found when resolving dependencies") - )) { - log.error('[BACKEND STARTUP] UV dependency installation failed'); - - // Clean up installing lock file - InstallLogs.cleanLockPath(); - log.info('[BACKEND STARTUP] Cleaned up uv_installing.lock file after failure'); - - safeMainWindowSend('install-dependencies-complete', { - success: false, - error: 'Dependency installation failed during backend startup' - }); - } } \ No newline at end of file