@echo off setlocal enabledelayedexpansion echo ================================================================ echo AI MESH ORCHESTRATOR - VERSION PORTABLE echo Installation sur cle USB / disque amovible echo ================================================================ echo. REM Detecter lecteur actuel set PORTABLE_DIR=%~dp0 echo Installation portable dans: %PORTABLE_DIR% echo. echo AVERTISSEMENT: echo Cette version portable necessite Node.js installe sur le PC hote echo Si Node.js n'est pas installe, utilisez: setup-portable-standalone.bat echo. echo Continuer? (O/N) set /p continue= if /i not "%continue%"=="O" exit /b 0 echo. echo [1/8] Verification structure... REM Creer structure 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" if not exist "node_modules" mkdir "node_modules" echo ✓ Structure creee echo. echo [2/8] Configuration .env... if not exist ".env" ( if exist ".env.example" ( copy /Y ".env.example" ".env" >nul echo ✓ Fichier .env cree ) else ( echo ! .env.example manquant ) ) else ( echo ✓ Fichier .env existe ) echo. echo [3/8] Verification Node.js sur PC hote... node --version >nul 2>&1 if %errorLevel% neq 0 ( echo. echo X Node.js non detecte sur ce PC echo. echo OPTIONS: echo 1. Installez Node.js: https://nodejs.org/ echo 2. Utilisez setup-portable-standalone.bat (inclut Node.js) echo. pause exit /b 1 ) for /f "tokens=*" %%i in ('node --version') do set NODE_VERSION=%%i echo ✓ Node.js %NODE_VERSION% detecte echo. echo [4/8] Verification dependances... if not exist "node_modules\express" ( echo Installation des dependances... call npm install --production --silent if %errorLevel% neq 0 ( echo X Installation echouee pause exit /b 1 ) echo ✓ Dependances installees ) else ( echo ✓ Dependances presentes ) echo. echo [5/8] Creation fichier de lancement portable... ( echo @echo off echo cd /d "%%~dp0" echo. echo REM Verifier Node.js echo node --version ^>nul 2^>^&1 echo if %%errorLevel%% neq 0 ^( echo echo X Node.js non installe sur ce PC echo echo Installez depuis: https://nodejs.org/ echo pause echo exit /b 1 echo ^) echo. echo echo Demarrage AI Mesh Orchestrator Portable... echo start "" http://localhost:3000 echo npm start ) > "launch-portable.bat" echo ✓ Fichier de lancement cree echo. echo [6/8] Creation script de synchronisation... ( echo @echo off echo echo ================================================================ echo echo SYNCHRONISATION PORTABLE ^<-^> FIXE echo echo ================================================================ echo echo. echo echo 1. Exporter vers PC fixe echo echo 2. Importer depuis PC fixe 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 set /p target=Chemin du PC fixe ^(ex: C:\Program Files\AIInteroperability^): echo if not exist "%%target%%" ^( echo echo X Chemin invalide echo pause echo goto END echo ^) echo echo Export en cours... echo xcopy /E /I /Y /Q "database" "%%target%%\database" echo xcopy /E /I /Y /Q "memory" "%%target%%\memory" echo copy /Y ".env" "%%target%%\" echo echo ✓ Export termine vers %%target%% echo pause echo goto END echo. echo :IMPORT echo set /p source=Chemin du PC fixe ^(ex: C:\Program Files\AIInteroperability^): echo if not exist "%%source%%" ^( echo echo X Chemin invalide echo pause echo goto END echo ^) echo echo Import en cours... echo xcopy /E /I /Y /Q "%%source%%\database" "database" echo xcopy /E /I /Y /Q "%%source%%\memory" "memory" echo copy /Y "%%source%%\.env" ".env" echo echo ✓ Import termine depuis %%source%% echo pause echo goto END echo. echo :END ) > "sync-portable.bat" echo ✓ Script de synchronisation cree echo. echo [7/8] Creation fichier README... ( echo ================================================================ echo AI MESH ORCHESTRATOR - VERSION PORTABLE echo ================================================================ echo. echo LANCEMENT: echo Double-cliquez sur: launch-portable.bat echo. echo PREREQUIS: echo Node.js doit etre installe sur le PC hote echo Telecharger: https://nodejs.org/ echo. echo SYNCHRONISATION: echo 1. Executez: sync-portable.bat echo 2. Choisissez export ou import echo 3. Entrez le chemin de la version fixe echo. echo CONFIGURATION: echo Editez le fichier .env avec vos cles API 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. echo SUPPORT: echo Documentation complete dans README.md echo. echo ================================================================ ) > "README-PORTABLE.txt" echo ✓ README cree echo. echo [8/8] Finalisation... echo ✓ Installation portable terminee! echo. echo ================================================================ echo INSTALLATION PORTABLE TERMINEE echo ================================================================ echo. echo Emplacement: %PORTABLE_DIR% echo. echo PROCHAINES ETAPES: echo. echo 1. Editez .env pour ajouter vos cles API echo. echo 2. Lancez l'application: echo - Double-cliquez sur: launch-portable.bat echo. echo 3. Synchronisation avec PC fixe: echo - Executez: sync-portable.bat echo. echo IMPORTANT: echo - Gardez cette cle USB en lieu sur echo - Sauvegardez regulierement la memoire echo - Utilisez sync-portable.bat pour synchroniser echo. echo ================================================================ echo. endlocal pause