@echo off @rem --------------------------------------------------------------------------- @rem setup-windows.bat - provision a fresh Windows box for native development @rem --------------------------------------------------------------------------- @rem --- Non-admin (per-user) winget installs --- winget install Anthropic.ClaudeCode winget install Git.Git winget install Microsoft.PowerShell Microsoft.Sysinternals.ProcessExplorer Microsoft.Sysinternals.ProcessMonitor Microsoft.Sysinternals.SDelete Microsoft.VisualStudioCode Microsoft.WindowsTerminal winget install Python.Python.3.13 winget install WinMerge.WinMerge winget install WiXToolset.WiXCLI @rem OpenCppCoverage: native (PE) line coverage for the C++ binaries. run-coverage-occ.py drives the @rem pytest suite under it to produce an HTML report (the binaries under test build with PDBs, @rem which it reads). The installer elevates via UAC. winget install OpenCppCoverage.OpenCppCoverage @rem --- Non-elevated PowerShell half --- @rem WinMerge on the user PATH, BinSkim, and the global git config (identity + @rem core.sshCommand -> the Windows OpenSSH client, so git shares the Windows @rem ssh-agent). EDIT THE GIT IDENTITY at the top of setup-windows-no-uac.ps1 @rem before the first run. @rem @rem Deliberately NOT elevated: every step writes per-user state (the HKCU PATH, @rem the .gitconfig under %USERPROFILE%), which the elevated half would write to @rem the administrator profile instead. @rem @rem Non-fatal: these are conveniences, and the elevated half below is the part @rem worth the UAC prompt. A failure warns and provisioning continues. powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0setup-windows-no-uac.ps1" if not "%ERRORLEVEL%"=="0" echo [setup-windows] WARNING: setup-windows-no-uac.ps1 reported a failure ^(see above^); continuing. @rem --------------------------------------------------------------------------- @rem No package manager needed for the Windows build @rem @rem Just: @rem cd windows && cmake -B build -G "Visual Studio 17 2022" -A x64 && cmake --build build --config Release @rem --------------------------------------------------------------------------- @rem --- Elevated installs (VS2022, WDK, system tools) --- @rem The elevated script runs in its own window and logs to setup-windows-uac.log. @rem -PassThru + $p.ExitCode propagates its real exit code back through to ERRORLEVEL. set "UAC_LOG=%~dp0setup-windows-uac.log" if exist "%UAC_LOG%" del "%UAC_LOG%" powershell -NoProfile -Command "$p = Start-Process powershell -Verb RunAs -ArgumentList '-NoProfile','-ExecutionPolicy','Bypass','-File','""%~dp0setup-windows-with-uac.ps1""' -Wait -PassThru; exit $p.ExitCode" set "UAC_RC=%ERRORLEVEL%" @rem --- Surface the elevated session's output (its window has already closed) --- if exist "%UAC_LOG%" ( echo. echo ===== elevated setup log ^(%UAC_LOG%^) ===== type "%UAC_LOG%" echo ===== end of elevated setup log ===== ) else ( echo [setup-windows] WARNING: no elevated log found at "%UAC_LOG%". echo [setup-windows] The elevated window may have been cancelled at the UAC prompt. ) if not "%UAC_RC%"=="0" ( echo. echo [setup-windows] ELEVATED SETUP FAILED ^(exit code %UAC_RC%^). See log above. exit /b %UAC_RC% ) echo. echo [setup-windows] Elevated setup completed successfully. @rem Removed: this doesn't work as well as I hoped, maybe try again later @rem -- Install Headroom --- @rem py -m pip install "headroom-ai[all]" @rem npm install headroom-ai py -m pip install Pillow