@echo off setlocal enabledelayedexpansion echo ================================================================ echo AI MESH ORCHESTRATOR - AUTO-INSTALLATION WINDOWS 64 echo Version Fixe - Installation Complete Automatique echo ================================================================ echo. REM Verifier les privileges admin net session >nul 2>&1 if %errorLevel% neq 0 ( echo. echo [AVERTISSEMENT] Privileges administrateur recommandes echo Voulez-vous continuer sans privileges admin? (O/N) set /p continue= if /i not "!continue!"=="O" exit /b 1 ) REM Detecter architecture echo [1/12] Detection architecture systeme... if "%PROCESSOR_ARCHITECTURE%"=="AMD64" ( set ARCH=x64 echo ✓ Architecture: x64 detectee ) else ( echo X Architecture incompatible - Requis: Windows 64-bit pause exit /b 1 ) REM Definir chemin installation set INSTALL_DIR=%ProgramFiles%\AIInteroperability echo. echo Chemin d'installation: %INSTALL_DIR% echo. REM Creer dossier installation echo [2/12] Creation dossier d'installation... if not exist "%INSTALL_DIR%" ( mkdir "%INSTALL_DIR%" echo ✓ Dossier cree ) else ( echo ✓ Dossier existe deja ) REM Verifier Node.js echo. echo [3/12] Verification Node.js... node --version >nul 2>&1 if %errorLevel% neq 0 ( echo X Node.js non installe echo. echo Telechargement et installation de Node.js... REM Telecharger Node.js powershell -Command "& {Invoke-WebRequest -Uri 'https://nodejs.org/dist/v20.11.0/node-v20.11.0-x64.msi' -OutFile '%TEMP%\nodejs.msi'}" if exist "%TEMP%\nodejs.msi" ( echo Installation Node.js en cours... msiexec /i "%TEMP%\nodejs.msi" /qn /norestart REM Attendre fin installation timeout /t 10 /nobreak >nul REM Rafraichir PATH call refreshenv.cmd 2>nul node --version >nul 2>&1 if %errorLevel% neq 0 ( echo X Installation Node.js echouee echo Installez manuellement: https://nodejs.org/ pause exit /b 1 ) ) else ( echo X Telechargement Node.js echoue echo Installez manuellement: https://nodejs.org/ pause exit /b 1 ) ) for /f "tokens=*" %%i in ('node --version') do set NODE_VERSION=%%i echo ✓ Node.js %NODE_VERSION% detecte REM Verifier npm echo. echo [4/12] Verification npm... call npm --version >nul 2>&1 if %errorLevel% neq 0 ( echo X npm non installe pause exit /b 1 ) for /f "tokens=*" %%i in ('npm --version') do set NPM_VERSION=%%i echo ✓ npm %NPM_VERSION% detecte REM Copier fichiers source echo. echo [5/12] Copie des fichiers source... xcopy /E /I /Y /Q "%~dp0\*" "%INSTALL_DIR%\" >nul 2>&1 echo ✓ Fichiers copies REM Aller dans le dossier installation cd /d "%INSTALL_DIR%" REM Installation dependances echo. echo [6/12] Installation des dependances npm... echo (Cela peut prendre 2-5 minutes) call npm install --production --silent if %errorLevel% neq 0 ( echo X Installation dependances echouee pause exit /b 1 ) echo ✓ Dependances installees REM Creer fichier .env echo. echo [7/12] Configuration fichier .env... if not exist ".env" ( copy /Y ".env.example" ".env" >nul echo ✓ Fichier .env cree ) else ( echo ✓ Fichier .env existe ) REM Creer structure dossiers echo. echo [8/12] Creation structure de dossiers... if not exist "database" mkdir "database" if not exist "memory" mkdir "memory" if not exist "memory\contexts" mkdir "memory\contexts" if not exist "memory\knowledge" mkdir "memory\knowledge" if not exist "memory\projects" mkdir "memory\projects" if not exist "output" mkdir "output" if not exist "output\zips" mkdir "output\zips" if not exist "output\sessions" mkdir "output\sessions" if not exist "output\logs" mkdir "output\logs" if not exist "sync" mkdir "sync" echo ✓ Dossiers crees REM Creer raccourci Bureau echo. echo [9/12] Creation raccourci Bureau... set SHORTCUT=%USERPROFILE%\Desktop\AI Mesh Orchestrator.lnk powershell -Command "$WshShell = New-Object -ComObject WScript.Shell; $Shortcut = $WshShell.CreateShortcut('%SHORTCUT%'); $Shortcut.TargetPath = '%INSTALL_DIR%\launch.bat'; $Shortcut.WorkingDirectory = '%INSTALL_DIR%'; $Shortcut.IconLocation = '%INSTALL_DIR%\public\icon.ico'; $Shortcut.Description = 'AI Mesh Orchestrator'; $Shortcut.Save()" if exist "%SHORTCUT%" ( echo ✓ Raccourci cree sur le Bureau ) else ( echo ! Impossible de creer le raccourci ) REM Creer fichier de lancement echo. echo [10/12] Creation fichier de lancement... ( echo @echo off echo cd /d "%INSTALL_DIR%" echo start "" http://localhost:3000 echo npm start ) > "%INSTALL_DIR%\launch.bat" echo ✓ Fichier de lancement cree REM Creer script de synchronisation echo. echo [11/12] Creation script de synchronisation... ( echo @echo off echo echo ================================================================ echo echo SYNCHRONISATION FIXE ^<-^> PORTABLE echo echo ================================================================ echo echo. echo echo 1. Exporter vers portable echo echo 2. Importer depuis portable echo echo 3. Annuler echo echo. echo set /p choice=Votre choix: echo. echo if "%%choice%%"=="1" goto EXPORT echo if "%%choice%%"=="2" goto IMPORT echo goto END echo. echo :EXPORT echo echo Export en cours... echo if not exist "sync\export" mkdir "sync\export" echo xcopy /E /I /Y /Q "database" "sync\export\database" echo xcopy /E /I /Y /Q "memory" "sync\export\memory" echo xcopy /Y ".env" "sync\export\" echo echo ✓ Export termine: sync\export\ echo echo Copiez le dossier sync\export vers votre cle USB echo pause echo goto END echo. echo :IMPORT echo echo Import en cours... echo if exist "sync\import\database" xcopy /E /I /Y /Q "sync\import\database" "database" echo if exist "sync\import\memory" xcopy /E /I /Y /Q "sync\import\memory" "memory" echo if exist "sync\import\.env" copy /Y "sync\import\.env" ".env" echo echo ✓ Import termine echo pause echo goto END echo. echo :END ) > "%INSTALL_DIR%\sync.bat" echo ✓ Script de synchronisation cree REM Installation terminee echo. echo [12/12] Finalisation installation... echo ✓ Installation terminee avec succes! echo. echo ================================================================ echo INSTALLATION TERMINEE echo ================================================================ echo. echo Installation: %INSTALL_DIR% echo. echo PROCHAINES ETAPES: echo. echo 1. Editez le fichier .env pour ajouter vos cles API echo Chemin: %INSTALL_DIR%\.env echo. echo 2. Lancez l'application: echo - Double-cliquez sur le raccourci Bureau echo - Ou executez: %INSTALL_DIR%\launch.bat echo. echo 3. Synchronisation avec version portable: echo - Executez: %INSTALL_DIR%\sync.bat echo. echo CLES API GRATUITES: echo - DeepSeek: https://platform.deepseek.com echo - Groq: https://console.groq.com echo - Together AI: https://api.together.xyz echo - Hugging Face: https://huggingface.co/settings/tokens echo - Cohere: https://dashboard.cohere.com echo - Mistral: https://console.mistral.ai echo - OpenRouter: https://openrouter.ai/keys echo. echo ================================================================ echo. echo Voulez-vous lancer l'application maintenant? (O/N) set /p launch= if /i "%launch%"=="O" ( start "" "%INSTALL_DIR%\launch.bat" ) endlocal pause