@echo off rem Install dmcp on Windows 10 (1803+) / 11. Download https://mcp.deemwar.com/install.cmd and rem double-click it, or run it from cmd.exe. "install.cmd /quiet" skips the final pause. rem Uses only built-in tools (curl.exe, certutil, reg; no PowerShell). Installs rem %LOCALAPPDATA%\dmcp\bin\dmcp.exe, checks its SHA-256, adds the folder to your user PATH (no admin). rem Safe to run again. Set DMCP_VERSION to pick a release. setlocal EnableExtensions EnableDelayedExpansion set "QUIET=" if /i "%~1"=="/quiet" set "QUIET=1" if not defined DMCP_DL_BASE set "DMCP_DL_BASE=https://mcp.deemwar.com/dl/dmcp" set "BASE=%DMCP_DL_BASE%" set "DIR=%LOCALAPPDATA%\dmcp\bin" if defined DMCP_INSTALL_DIR set "DIR=%DMCP_INSTALL_DIR%" set "ARCH=amd64" if /i "%PROCESSOR_ARCHITECTURE%"=="ARM64" set "ARCH=arm64" if /i "%PROCESSOR_ARCHITEW6432%"=="ARM64" set "ARCH=arm64" set "NAME=dmcp_windows_%ARCH%.exe" where curl.exe >nul 2>&1 || ( echo dmcp install: needs curl.exe ^(built into Windows 10 1803 and later^) & goto :fail ) set "TMPD=%TEMP%\dmcp-install-%RANDOM%%RANDOM%" mkdir "%TMPD%" >nul 2>&1 set "VERSION=%DMCP_VERSION%" if not defined VERSION ( curl.exe -fsSL -o "%TMPD%\latest.json" "%BASE%/latest.json" || ( echo dmcp install: could not reach %BASE%/latest.json & goto :failclean ) rem {"version":"v0.1.0-alpha",...}: the 4th "-delimited token for /f usebackq^ tokens^=4^ delims^=^" %%v in ("%TMPD%\latest.json") do if not defined VERSION set "VERSION=%%v" ) if not defined VERSION ( echo dmcp install: could not read %BASE%/latest.json & goto :failclean ) if exist "%DIR%\dmcp.exe" ( for /f "tokens=2" %%v in ('"%DIR%\dmcp.exe" version 2^>nul') do if "%%v"=="%VERSION%" ( echo dmcp %VERSION% is already installed at %DIR%\dmcp.exe goto :path ) ) echo Downloading dmcp %VERSION% (windows/%ARCH%)... curl.exe -fsSL -o "%TMPD%\checksums.txt" "%BASE%/%VERSION%/checksums.txt" || ( echo dmcp install: no release %VERSION% at %BASE% & goto :failclean ) curl.exe -fSL --progress-bar -o "%TMPD%\%NAME%" "%BASE%/%VERSION%/%NAME%" || ( echo dmcp install: download of %NAME% failed & goto :failclean ) set "WANT=" for /f "usebackq tokens=1,2" %%a in ("%TMPD%\checksums.txt") do ( if /i "%%b"=="%NAME%" set "WANT=%%a" if /i "%%b"=="*%NAME%" set "WANT=%%a" ) if not defined WANT ( echo dmcp install: %NAME% is not in the %VERSION% checksums & goto :failclean ) set "GOT=" for /f "skip=1 delims=" %%h in ('certutil -hashfile "%TMPD%\%NAME%" SHA256') do if not defined GOT set "GOT=%%h" set "GOT=%GOT: =%" if /i not "%GOT%"=="%WANT%" ( echo dmcp install: checksum mismatch for %NAME% ^(got %GOT%, want %WANT%^); nothing was installed & goto :failclean ) if not exist "%DIR%" mkdir "%DIR%" rem A running dmcp.exe can be renamed but not overwritten. if exist "%DIR%\dmcp.exe" ( del /f /q "%DIR%\dmcp.exe.old" >nul 2>&1 & move /y "%DIR%\dmcp.exe" "%DIR%\dmcp.exe.old" >nul ) move /y "%TMPD%\%NAME%" "%DIR%\dmcp.exe" >nul || ( echo dmcp install: could not write %DIR%\dmcp.exe & goto :failclean ) echo Installed dmcp %VERSION% to %DIR%\dmcp.exe (SHA-256 verified) :path if exist "%TMPD%" rmdir /s /q "%TMPD%" >nul 2>&1 rem User PATH via the registry (setx would truncate it at 1024 characters); skip when already there. set "UPATH=" for /f "tokens=2,*" %%a in ('reg query HKCU\Environment /v Path 2^>nul ^| findstr /i "REG_"') do set "UPATH=%%b" echo ;!UPATH!; | findstr /i /l /c:";%DIR%;" >nul if errorlevel 1 ( if defined UPATH ( set "NEWPATH=%DIR%;!UPATH!" ) else ( set "NEWPATH=%DIR%" ) reg add HKCU\Environment /v Path /t REG_EXPAND_SZ /d "!NEWPATH!" /f >nul || ( echo dmcp install: could not update your PATH; add %DIR% yourself & goto :next ) rem setx on a harmless variable makes Explorer pick up the new PATH for new windows. setx DMCP_HOME "%DIR%" >nul 2>&1 echo Added %DIR% to your user PATH. ) :next echo. echo Next, open a NEW terminal and run: echo dmcp login sign in (opens your browser) echo dmcp terminal setup installs klark or herdr to run your agents in echo dmcp terminal serve ^ --publish echo dmcp terminal connect how to add the URL to ChatGPT, Grok, Claude, Codex echo. echo Docs: https://mcp.deemwar.com/docs/dmcp/ if not defined QUIET pause exit /b 0 :failclean rmdir /s /q "%TMPD%" >nul 2>&1 :fail if not defined QUIET pause exit /b 1