]> vilimpoc.org git repositories - dotfiles/blob - setup-windows.bat
dotfiles: install VirtualBox with the other winget packages
[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 Oracle.VirtualBox\r
12 winget install Python.Python.3.13\r
13 winget install WinMerge.WinMerge\r
14 winget install WiXToolset.WiXCLI\r
15 \r
16 @rem OpenCppCoverage: native (PE) line coverage for the C++ binaries. run-coverage-occ.py drives the\r
17 @rem pytest suite under it to produce an HTML report (the binaries under test build with PDBs,\r
18 @rem which it reads). The installer elevates via UAC.\r
19 winget install OpenCppCoverage.OpenCppCoverage\r
20 \r
21 @rem ---------------------------------------------------------------------------\r
22 @rem No package manager needed for the Windows build\r
23 @rem\r
24 @rem Just:\r
25 @rem   cd windows && cmake -B build -G "Visual Studio 17 2022" -A x64 && cmake --build build --config Release\r
26 @rem ---------------------------------------------------------------------------\r
27 \r
28 @rem --- Elevated installs (VS2022, WDK, system tools) ---\r
29 @rem The elevated script runs in its own window and logs to setup-windows-uac.log.\r
30 @rem -PassThru + $p.ExitCode propagates its real exit code back through to ERRORLEVEL.\r
31 set "UAC_LOG=%~dp0setup-windows-uac.log"\r
32 if exist "%UAC_LOG%" del "%UAC_LOG%"\r
33 \r
34 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
35 set "UAC_RC=%ERRORLEVEL%"\r
36 \r
37 @rem --- Surface the elevated session's output (its window has already closed) ---\r
38 if exist "%UAC_LOG%" (\r
39     echo.\r
40     echo ===== elevated setup log ^(%UAC_LOG%^) =====\r
41     type "%UAC_LOG%"\r
42     echo ===== end of elevated setup log =====\r
43 ) else (\r
44     echo [setup-windows] WARNING: no elevated log found at "%UAC_LOG%".\r
45     echo [setup-windows] The elevated window may have been cancelled at the UAC prompt.\r
46 )\r
47 \r
48 @rem --- Non-elevated PowerShell half ---\r
49 @rem WinMerge on the user PATH, BinSkim, and the global git config (identity +\r
50 @rem core.sshCommand -> a Win32-OpenSSH client, so git shares the Windows\r
51 @rem ssh-agent). EDIT THE GIT IDENTITY at the top of setup-windows-no-uac.ps1\r
52 @rem before the first run.\r
53 @rem\r
54 @rem Deliberately NOT elevated: every step writes per-user state (the HKCU PATH,\r
55 @rem the .gitconfig under %USERPROFILE%), which the elevated half would write to\r
56 @rem the administrator profile instead.\r
57 @rem\r
58 @rem AFTER the elevated half on purpose: core.sshCommand prefers the ssh.exe that\r
59 @rem half unpacks beside rsync.exe - a push through the in-box client is capped\r
60 @rem at ~17MB/s - and it can only prefer it once it is on disk. Run either way,\r
61 @rem including when the elevated half failed above: nothing here depends on it,\r
62 @rem and the fallback is the in-box client that Windows already has.\r
63 @rem\r
64 @rem Non-fatal: these are conveniences, and the elevated half is the part worth\r
65 @rem the UAC prompt. A failure warns and provisioning continues.\r
66 powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0setup-windows-no-uac.ps1"\r
67 if not "%ERRORLEVEL%"=="0" echo [setup-windows] WARNING: setup-windows-no-uac.ps1 reported a failure ^(see above^); continuing.\r
68 \r
69 if not "%UAC_RC%"=="0" (\r
70     echo.\r
71     echo [setup-windows] ELEVATED SETUP FAILED ^(exit code %UAC_RC%^). See log above.\r
72     exit /b %UAC_RC%\r
73 )\r
74 echo.\r
75 echo [setup-windows] Elevated setup completed successfully.\r
76 \r
77 @rem Removed: this doesn't work as well as I hoped, maybe try again later\r
78 @rem -- Install Headroom ---\r
79 @rem py -m pip install "headroom-ai[all]"\r
80 @rem npm install headroom-ai\r
81 \r
82 py -m pip install Pillow