@echo off
setlocal EnableExtensions

set "APP_DIR=%~dp0app"
cd /d "%APP_DIR%"

set "NPM_CMD=%~dp0runtime\node\npm.cmd"
if exist "%NPM_CMD%" goto npm_ready
where npm >nul 2>nul
if errorlevel 1 (
  echo 未找到 npm。请先安装 Node.js 20+。
  pause
  exit /b 1
)
set "NPM_CMD=npm"
:npm_ready

echo 正在重新安装 Windows 依赖，请保持网络可用...
"%NPM_CMD%" install
pause
