]> vilimpoc.org git repositories - dotfiles/blob - setup-windows.bat
f69eceda8eea2af3c0bd5ec2ce4ceaf45cc34f09
[dotfiles] / setup-windows.bat
1 @echo off\r
2 \r
3 @rem ---------------------------------------------------------------------------\r
4 @rem setup-windows.bat - provision a fresh Windows box for native development\r
5 @rem ---------------------------------------------------------------------------\r
6 \r
7 @rem --- Non-admin (per-user) winget installs ---\r
8 winget install Anthropic.ClaudeCode\r
9 winget install Git.Git\r
10 winget install Microsoft.PowerShell Microsoft.Sysinternals.ProcessExplorer Microsoft.Sysinternals.ProcessMonitor Microsoft.Sysinternals.SDelete Microsoft.VisualStudioCode Microsoft.WindowsTerminal\r
11 winget install Python.Python.3.13\r
12 winget install WinMerge.WinMerge\r
13 winget install WiXToolset.WiXCLI\r
14 \r
15 @rem OpenCppCoverage: native (PE) line coverage for the C++ binaries. run-coverage-occ.py drives the\r
16 @rem pytest suite under it to produce an HTML report (the binaries under test build with PDBs,\r
17 @rem which it reads). The installer elevates via UAC.\r
18 winget install OpenCppCoverage.OpenCppCoverage\r
19 \r
20 @rem --- Non-elevated PowerShell half ---\r
21 @rem WinMerge on the user PATH, BinSkim, and the global git config (identity +\r
22 @rem core.sshCommand -> the Windows OpenSSH client, so git shares the Windows\r
23 @rem ssh-agent). EDIT THE GIT IDENTITY at the top of setup-windows-no-uac.ps1\r
24 @rem before the first run.\r
25 @rem\r
26 @rem Deliberately NOT elevated: every step writes per-user state (the HKCU PATH,\r
27 @rem the .gitconfig under %USERPROFILE%), which the elevated half would write to\r
28 @rem the administrator profile instead.\r
29 @rem\r
30 @rem Non-fatal: these are conveniences, and the elevated half below is the part\r
31 @rem worth the UAC prompt. A failure warns and provisioning continues.\r
32 powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0setup-windows-no-uac.ps1"\r
33 if not "%ERRORLEVEL%"=="0" echo [setup-windows] WARNING: setup-windows-no-uac.ps1 reported a failure ^(see above^); continuing.\r
34 \r
35 @rem ---------------------------------------------------------------------------\r
36 @rem No package manager needed for the Windows build\r
37 @rem\r
38 @rem Just:\r
39 @rem   cd windows && cmake -B build -G "Visual Studio 17 2022" -A x64 && cmake --build build --config Release\r
40 @rem ---------------------------------------------------------------------------\r
41 \r
42 @rem --- Elevated installs (VS2022, WDK, system tools) ---\r
43 @rem The elevated script runs in its own window and logs to setup-windows-uac.log.\r
44 @rem -PassThru + $p.ExitCode propagates its real exit code back through to ERRORLEVEL.\r
45 set "UAC_LOG=%~dp0setup-windows-uac.log"\r
46 if exist "%UAC_LOG%" del "%UAC_LOG%"\r
47 \r
48 powershell -NoProfile -Command "$p = Start-Process powershell -Verb RunAs -ArgumentList '-NoProfile','-ExecutionPolicy','Bypass','-File','""%~dp0setup-windows-with-uac.ps1""' -Wait -PassThru; exit $p.ExitCode"\r
49 set "UAC_RC=%ERRORLEVEL%"\r
50 \r
51 @rem --- Surface the elevated session's output (its window has already closed) ---\r
52 if exist "%UAC_LOG%" (\r
53     echo.\r
54     echo ===== elevated setup log ^(%UAC_LOG%^) =====\r
55     type "%UAC_LOG%"\r
56     echo ===== end of elevated setup log =====\r
57 ) else (\r
58     echo [setup-windows] WARNING: no elevated log found at "%UAC_LOG%".\r
59     echo [setup-windows] The elevated window may have been cancelled at the UAC prompt.\r
60 )\r
61 \r
62 if not "%UAC_RC%"=="0" (\r
63     echo.\r
64     echo [setup-windows] ELEVATED SETUP FAILED ^(exit code %UAC_RC%^). See log above.\r
65     exit /b %UAC_RC%\r
66 )\r
67 echo.\r
68 echo [setup-windows] Elevated setup completed successfully.\r
69 \r
70 @rem Removed: this doesn't work as well as I hoped, maybe try again later\r
71 @rem -- Install Headroom ---\r
72 @rem py -m pip install "headroom-ai[all]"\r
73 @rem npm install headroom-ai\r
74 \r
75 py -m pip install Pillow