From d6a4e0966d8051f05bb9041d6ea0c1db92f99109 Mon Sep 17 00:00:00 2001 From: Sun Tao <2605127667@qq.com> Date: Thu, 20 Nov 2025 00:40:07 +0800 Subject: [PATCH] Update useInstallationSetup.ts --- src/hooks/useInstallationSetup.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hooks/useInstallationSetup.ts b/src/hooks/useInstallationSetup.ts index 228c70730..018828232 100644 --- a/src/hooks/useInstallationSetup.ts +++ b/src/hooks/useInstallationSetup.ts @@ -14,6 +14,7 @@ export const useInstallationSetup = () => { // Extract only the functions we need to avoid dependency issues const startInstallation = useInstallationStore(state => state.startInstallation); + const performInstallation = useInstallationStore(state => state.performInstallation); const addLog = useInstallationStore(state => state.addLog); const setSuccess = useInstallationStore(state => state.setSuccess); const setError = useInstallationStore(state => state.setError); @@ -60,6 +61,13 @@ export const useInstallationSetup = () => { if (installationStatus.success && installationStatus.isInstalling) { startInstallation(); + } else if (initState !== 'done') { + // If not installing and not done, check if we need to install + const toolResult = await window.ipcRenderer.invoke("check-tool-installed"); + if (toolResult.success && !toolResult.isInstalled) { + console.log('[useInstallationSetup] Tools missing and not installing. Starting installation...'); + performInstallation(); + } } } catch (err) { console.error('[useInstallationSetup] Failed to check installation status:', err);