diff --git a/CHANGELOG.md b/CHANGELOG.md index 70c5259..5873edf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,14 @@ format follows keep a changelog. versions are git tags like `v0.1.0`. ## [Unreleased] ### added - repository health files and read-only CI validation. +- `docs/APPS.md` with install IDs, config paths, theme scope, and manual steps for the desktop apps. +- configured LibreWolf and Mem Reduct folders. LibreWolf gets safe `defaultPref` overrides and three profiles; Mem Reduct gets a comment-only portable config. ### changed +- the IoT browser is now `LibreWolf.LibreWolf` with configured profiles and overrides. Default browser is a printed Settings step, not a forced launch. +- qBittorrent now ships with WebUI off, UPnP off, no web password in the repo, and loopback only for local opt-in. +- Windows Terminal keeps Windows PowerShell 5.1 and Command Prompt, starts in the user profile, and drops the stale PowerShell 7 entry. +- daily and IoT VSCodium settings now activate the bundled Graphite Amber theme instead of a default theme with duplicate color overrides. - rewrote the README around quick start, profiles, verification, and repo layout. added `QUICKSTART.md` and local Graphite Amber preview cards. refreshed repo description and topics. - switched banners, badges, VSCodium, and Windows Terminal to Graphite Amber. the old theme family is gone. - renamed the repo to `win11-engineering-stack`. the old URL still redirects. @@ -27,6 +33,10 @@ format follows keep a changelog. versions are git tags like `v0.1.0`. - deleted the `tests/` suite on request. `-DryRun` is the remaining preflight check. ### fixed +- IoT `-Verify` now runs before log, state, transcript, and report setup, so the read-only path writes nothing. +- `Install.ps1 -Verify` is an alias for the matching validator, `Install.ps1 -Status` reports saved daily state, and `Validate.ps1` defaults to `daily`. +- the UAC relaunch waits for the elevated child and returns its exit code. daily modules can mark failure, and the run summary prints ok, skip, warn, and fail counts with the next command. +- the IoT 7-Zip smoke test accepts `C:\Program Files\7-Zip\7z.exe` when `7z` is not on `PATH`. - IoT `-Verify` now reads the VSCodium theme property directly. the old call used a helper that the standalone script never loaded, so existing settings were misreported as invalid JSON. - dry-run output now says that logs and the IoT report are still written. theme and config messages no longer claim a write happened in dry-run. - daily module discovery now uses `-File`, and preflight no longer creates the log root that the front door already creates. diff --git a/Helium/README.md b/Helium/README.md deleted file mode 100644 index 532589a..0000000 --- a/Helium/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Helium -- `master_preferences` only matters on FIRST run (homepage, home button, - bookmark bar). Already opened Helium once? Then it's ignored, use the UI. - Fresh setups get it dropped into `%LOCALAPPDATA%\Helium\User Data\`. -- Theme: Chrome Web Store > any red/black theme (Helium takes Chrome themes). -- Recommended: Settings > Appearance > font JetBrainsMono Nerd Font where - offered; Privacy: block third-party cookies; set Helium as default - (installer tries `--make-default-browser`, confirm in Windows Settings). -- Lives on ws2 here (`Win+2`). -- Nothing to tune, honestly. Helium already blocks ads/trackers/cookie - banners, forces HTTPS, and naps idle tabs by itself. Leave the flags page - alone. -- Two extensions worth grabbing from the Chrome store: Bitwarden (passwords) - and SponsorBlock (skips sponsor segments in lecture recordings you watch - back). uBlock is already built in, don't double up. diff --git a/Helium/master_preferences b/Helium/master_preferences deleted file mode 100644 index 1e9b8e5..0000000 --- a/Helium/master_preferences +++ /dev/null @@ -1,18 +0,0 @@ -{ - "homepage": "https://www.google.com", - "homepage_is_newtabpage": true, - "browser": { - "show_home_button": true - }, - "bookmark_bar": { - "show_on_all_tabs": true - }, - "distribution": { - "skip_first_run_ui": true, - "show_welcome_page": false, - "import_bookmarks": false, - "import_history": false, - "import_home_page": false, - "do_not_create_desktop_shortcut": true - } -} diff --git a/Install.ps1 b/Install.ps1 index b5797e1..41114e7 100644 --- a/Install.ps1 +++ b/Install.ps1 @@ -6,16 +6,25 @@ .DESCRIPTION -Profile daily runs the modular engineering setup. -Profile iot runs the slim LTSC installer. - Extra switches pass through to that profile unchanged. + Common switches are declared here. Other switches pass through unchanged. + -Verify calls the matching validator. -Status is daily only. .EXAMPLE .\Install.ps1 -Profile daily -DryRun .\Install.ps1 -Profile iot -DryRun .\Install.ps1 -Profile iot -ConfigsOnly + .\Install.ps1 -Profile daily -Verify + .\Install.ps1 -Profile daily -Status #> [CmdletBinding()] param( [ValidateSet('daily', 'iot')][string]$Profile = 'daily', + [switch]$DryRun, + [switch]$Force, + [string[]]$Only = @(), + [switch]$Resume, + [switch]$Verify, + [switch]$Status, [Parameter(ValueFromRemainingArguments = $true)][string[]]$PassThru = @() ) @@ -23,6 +32,18 @@ Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' $root = Split-Path -Parent $MyInvocation.MyCommand.Path + +if ($Verify) { + $entry = Join-Path $root 'Validate.ps1' + & powershell -NoProfile -ExecutionPolicy Bypass -File $entry -Profile $Profile + if ($null -ne $LASTEXITCODE -and $LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + exit 0 +} + +if ($Status -and $Profile -ne 'daily') { + throw '-Status is only available for the daily profile.' +} + if ($Profile -eq 'iot') { $entry = Join-Path $root 'install-Win-Iot.ps1' } @@ -34,8 +55,14 @@ if (-not (Test-Path -LiteralPath $entry)) { throw "Missing profile entry point: $entry" } -& powershell -NoProfile -ExecutionPolicy Bypass -File $entry @PassThru -if ($null -ne $LASTEXITCODE -and $LASTEXITCODE -ne 0) { - exit $LASTEXITCODE -} +$arguments = @() +if ($DryRun) { $arguments += '-DryRun' } +if ($Force) { $arguments += '-Force' } +if ($Only.Count -gt 0) { $arguments += @('-Only', ($Only -join ',')) } +if ($Resume) { $arguments += '-Resume' } +if ($Status) { $arguments += '-Status' } +$arguments += $PassThru + +& powershell -NoProfile -ExecutionPolicy Bypass -File $entry @arguments +if ($null -ne $LASTEXITCODE -and $LASTEXITCODE -ne 0) { exit $LASTEXITCODE } exit 0 diff --git a/LibreWolf/README.md b/LibreWolf/README.md new file mode 100644 index 0000000..224d503 --- /dev/null +++ b/LibreWolf/README.md @@ -0,0 +1,31 @@ +# LibreWolf + +The browser in the IoT profile is `LibreWolf.LibreWolf`. It is in the core app +list. The installer is used, not the portable launcher. + +## What the script places + +- `%USERPROFILE%\.librewolf\librewolf.overrides.cfg`, fresh-only. +- Three profiles under `%APPDATA%\LibreWolf\Profiles`: `personal`, `uni`, `social`. +- Start Menu shortcuts that open each profile with `-P -no-remote`. + +The overrides file uses `defaultPref`, so anything you change in the UI wins on +the next run. LibreWolf ships hardened. This file only sets startup behavior and +an explicit warning before closing several tabs. No site-breaking prefs. + +## What stays manual + +Windows 11 protects the default browser choice. The script prints the step +instead of forcing it: + +```text +Settings > Apps > Default apps > Web browser > LibreWolf +``` + +Sign in to each profile separately. Do not reuse a personal account in the uni +or social profile. + +## Theme + +LibreWolf keeps its native light UI. Engineering apps stay native light; only +Windows Terminal and VSCodium use Graphite Amber. diff --git a/LibreWolf/librewolf.overrides.cfg b/LibreWolf/librewolf.overrides.cfg new file mode 100644 index 0000000..c0e4259 --- /dev/null +++ b/LibreWolf/librewolf.overrides.cfg @@ -0,0 +1,6 @@ +// librewolf.overrides.cfg +// safe defaults only. defaultPref lets the user override in the UI. +defaultPref("browser.startup.page", 1); +defaultPref("browser.startup.homepage", "about:home"); +defaultPref("browser.tabs.warnOnClose", true); +defaultPref("general.warnOnAboutConfig", false); diff --git a/MemReduct/README.md b/MemReduct/README.md new file mode 100644 index 0000000..5360bda --- /dev/null +++ b/MemReduct/README.md @@ -0,0 +1,26 @@ +# Mem Reduct + +Optional app in the IoT profile. Added with `-IncludeOptional`. Winget ID: +`Henry++.MemReduct`. The app needs admin rights for its Native API cleanup. + +## Config + +`memreduct.ini` is copied fresh-only to: + +```text +%APPDATA%\Henry++\Mem Reduct\memreduct.ini +``` + +The repo ships a comment-only file. Mem Reduct writes its own settings there on +first run, so the config stays valid across versions. No registry edits, no +password, no machine-specific path. + +## Behavior + +- No autostart. +- No interval cleanup. +- No threshold cleanup. +- Native light UI. + +This is a tray monitor you open by hand. It is not a tweak pass or a debloat +tool, and it does not touch Defender. diff --git a/MemReduct/memreduct.ini b/MemReduct/memreduct.ini new file mode 100644 index 0000000..f0cac3f --- /dev/null +++ b/MemReduct/memreduct.ini @@ -0,0 +1,3 @@ +; Mem Reduct config placeholder. +; The app writes its own settings here on first run. +; Auto-clean and autostart stay off by design. diff --git a/QUICKSTART.md b/QUICKSTART.md index ce9a2a0..91591ad 100644 --- a/QUICKSTART.md +++ b/QUICKSTART.md @@ -11,8 +11,8 @@ elevates itself when a step needs it. ``` `-DryRun` prints planned writes, downloads, and installs. it does not change -system settings, installs, or config files. logs and a report are still written. -read the output before the real run. +system settings, installs, or config files. daily still writes its log and +transcript; iot also writes a report. read the output before the real run. ## 2. run a profile @@ -28,28 +28,41 @@ old one-click flow. ## 3. verify without writing ```powershell -.\Validate.ps1 -Profile daily -.\Validate.ps1 -Profile iot +.\Install.ps1 -Profile daily -Verify +.\Install.ps1 -Profile iot -Verify ``` -exit 0 means the checked state is present. exit 1 means at least one real check -failed. host-only misses are reported as `FAIL` or `WARN` and do not change the -machine. +`-Verify` on the front door calls the matching validator. you can also call +`Validate.ps1` directly; it defaults to `daily`. exit 0 means the checked state +is present. exit 1 means at least one real check failed. neither path writes a +log, transcript, report, or setting. + +## 4. read daily state + +```powershell +.\Install.ps1 -Profile daily -Status +``` + +`-Status` prints completed modules, pending reboot, and the next command. it +reads the saved state file only. ## common filters ```powershell -.\scripts\Install.ps1 -Only os,apps -SxsPath D:\sources\sxs -.\scripts\Install.ps1 -Only engineering -TiaInstaller D:\TIA\Start.exe -MatlabInstaller D:\MATLAB\setup.exe -.\scripts\Install.ps1 -Resume +.\Install.ps1 -Profile daily -Only os,apps -SxsPath D:\sources\sxs +.\Install.ps1 -Profile daily -Only engineering -TiaInstaller D:\TIA\Start.exe -MatlabInstaller D:\MATLAB\setup.exe +.\Install.ps1 -Profile daily -Resume +.\Install.ps1 -Profile iot -ConfigsOnly ``` `install-Win-Iot.ps1 -?` lists the full IoT flag set. useful ones are `-Unattended`, `-ConfigsOnly`, `-OfflineDir`, `-NoWingetBootstrap`, -`-DriverDir`, `-Only`, `-SkipApps`, and `-Fixes`. +`-DriverDir`, `-Only`, `-SkipApps`, and `-IncludeOptional`. Mem Reduct is an +optional IoT app. ## where to go next +- [app inventory](docs/APPS.md) for install IDs, config paths, and manual steps - [CLI contract](docs/CLI.md) for front doors and flag meanings - [runbook](docs/RUNBOOK.md) for run order and manual steps - [security](SECURITY.md) for image assumptions and secrets diff --git a/README.md b/README.md index 29a31b6..3c25980 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,11 @@ filters, resume, and the full flag list, read [CLI contract](docs/CLI.md). ``` Exit 0 means the checked state is present. Exit 1 means at least one real check -failed. These commands only read system state. The IoT `-Verify` path writes a -log and transcript before the check. +failed. Both paths only read system state. Neither writes a log, transcript, or +report. `Install.ps1 -Verify` is an alias for the matching `Validate.ps1` call. + +Daily state is read-only with `.\Install.ps1 -Status`. It prints completed +modules, pending reboot, and the next command. ## What the modules do @@ -86,6 +89,16 @@ apps keep their native light theme. See the [visual standard](https://github.com/SOSMLG/.github/blob/main/docs/THEME.md) or [الطابع البصري](https://github.com/SOSMLG/.github/blob/main/docs/THEME.ar.md). +## Desktop apps + +See the [app inventory](docs/APPS.md) for install IDs, config paths, and manual steps. + +- 7-Zip is in both app lists. The IoT self-check also accepts the Program Files install path. +- qBittorrent ships with WebUI off, UPnP off, no stored web password, and loopback only if WebUI is enabled locally. Existing configs are kept. +- LibreWolf is the IoT browser. It gets three isolated profiles, Start Menu shortcuts, and safe `defaultPref` overrides. Default browser is a manual Settings step. +- Mem Reduct is optional via `-IncludeOptional`. No autostart, no scheduled cleanup, native light UI. +- Windows Terminal keeps one Graphite Amber scheme and no stale PowerShell 7 profile. + ## OmniRoute and OpenCode OmniRoute listens on `127.0.0.1:20128`. Set `OMNIROUTE_API_KEY` as a user diff --git a/THIRD-PARTY-NOTICES.md b/THIRD-PARTY-NOTICES.md index 424111f..07813bf 100644 --- a/THIRD-PARTY-NOTICES.md +++ b/THIRD-PARTY-NOTICES.md @@ -8,7 +8,7 @@ engines per app, first hit wins: staged `-OfflineDir` files, winget, GitHub rele | item | ids / source | license (confirm) | |---|---|---| -| Helium | `ImputNet.Helium` | | +| LibreWolf | `LibreWolf.LibreWolf` | | | VSCodium | `VSCodium.VSCodium` | | | Vesktop | `Vencord.Vesktop` | | | Telegram Desktop | `Telegram.TelegramDesktop` | | @@ -19,7 +19,7 @@ engines per app, first hit wins: staged `-OfflineDir` files, winget, GitHub rele | opencode | `SST.opencode`. CI also installs `opencode-ai@1.19.4` from npm to validate configs | | | shell pack | Starship, zoxide, fzf, bat, eza, Fastfetch | | | Windows Terminal | `Microsoft.WindowsTerminal` | | -| optional (`-IncludeOptional`) | Obsidian, Spotify | | +| optional (`-IncludeOptional`) | Obsidian, Spotify, Mem Reduct (`Henry++.MemReduct`) | | | runtimes | VC++ 2005 to 2022, .NET 8 Desktop Runtime | | | context7 MCP, Playwright MCP | `@upstash/context7-mcp@4.4.4`, `@playwright/mcp@0.0.83`, fetched by `npx` the first time OpenCode starts them | | diff --git a/Validate.ps1 b/Validate.ps1 index ce97d0e..057cdc1 100644 --- a/Validate.ps1 +++ b/Validate.ps1 @@ -4,13 +4,13 @@ Read-only validation for the selected profile. .DESCRIPTION + -Profile daily calls scripts/Validate.ps1 and is the default. -Profile iot calls install-Win-Iot.ps1 -Verify. - -Profile daily calls scripts/Validate.ps1. Neither path writes settings. #> [CmdletBinding()] param( - [ValidateSet('daily', 'iot')][string]$Profile = 'iot' + [ValidateSet('daily', 'iot')][string]$Profile = 'daily' ) Set-StrictMode -Version Latest diff --git a/Vesktop/quickcss.css b/Vesktop/quickcss.css index 56f3a55..7753b19 100644 --- a/Vesktop/quickcss.css +++ b/Vesktop/quickcss.css @@ -50,7 +50,7 @@ body { --custom-dms-background: off; /* off to disable, image to use a background image (must set url variable below), color to use a custom color/gradient */ --dms-background-image-url: url(''); /* url of the background image */ --dms-background-image-size: cover; /* size of the background image (css background-size property) */ - --dms-background-color: linear-gradient(70deg, var(--blue-2), var(--purple-2), var(--red-2)); /* fixed color/gradient (css background property) */ + --dms-background-color: var(--bg-3); /* flat graphite when a custom dms icon is enabled */ /* background image options */ --background-image: off; /* off: no background image, on: enable background image (must set url variable below) */ @@ -113,10 +113,10 @@ body { --accent-4: var(--red-4); /* accent buttons when hovered */ --accent-5: var(--red-5); /* accent buttons when clicked */ --accent-new: var(--red-2); /* muted/deafened controls use the accent */ - --mention: linear-gradient(to right, color-mix(in hsl, var(--accent-2), transparent 88%) 40%, transparent); /* background of messages that mention you */ - --mention-hover: linear-gradient(to right, color-mix(in hsl, var(--accent-2), transparent 93%) 40%, transparent); /* background of messages that mention you when hovered */ - --reply: linear-gradient(to right, color-mix(in hsl, var(--text-3), transparent 90%) 40%, transparent); /* background of messages that reply to you */ - --reply-hover: linear-gradient(to right, color-mix(in hsl, var(--text-3), transparent 95%) 40%, transparent); /* background of messages that reply to you when hovered */ + --mention: rgba(232, 163, 61, 0.12); /* background of messages that mention you */ + --mention-hover: rgba(232, 163, 61, 0.18); /* background of messages that mention you when hovered */ + --reply: rgba(216, 211, 200, 0.08); /* background of messages that reply to you */ + --reply-hover: rgba(216, 211, 200, 0.12); /* background of messages that reply to you when hovered */ /* status indicator colors */ --online: #8FB57A; diff --git a/WindowsTerminal/README.md b/WindowsTerminal/README.md index 0d1dd17..4908980 100644 --- a/WindowsTerminal/README.md +++ b/WindowsTerminal/README.md @@ -1,14 +1,18 @@ # Windows Terminal `install-Win-Iot.ps1` installs `Microsoft.WindowsTerminal` on builds that -support it and drops a `settings.json` into +support it and drops `settings.json` into `%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\` -on a fresh install only (fresh = terminal never launched). +on a fresh install only. The daily theme module keeps the same scheme on an +existing installation without replacing your profile list. What it sets: -- default profile: Windows PowerShell 5.1. pwsh and cmd sit next in the list -- graphite amber, JetBrainsMono Nerd Font 10, 10k scrollback, comfy padding -- stock color scheme, nothing fancy -if the terminal already ran once, our file loses (fresh-only rule). edit by -hand, or re-run with `-ConfigsOnly` to overwrite it. +- default profile: Windows PowerShell 5.1. Command Prompt is the other profile. + The stale PowerShell 7 entry is gone. +- one Graphite Amber scheme, JetBrains Mono Nerd Font Mono 11, 10k scrollback, + padding 8, start in `%USERPROFILE%`. +- no acrylic, no transparency, no custom actions. + +If the terminal already ran once, the IoT file loses under the fresh-only rule. +Edit by hand, or re-run with `-ConfigsOnly` to overwrite it. diff --git a/WindowsTerminal/settings.json b/WindowsTerminal/settings.json index f74e0c5..db1305c 100644 --- a/WindowsTerminal/settings.json +++ b/WindowsTerminal/settings.json @@ -9,6 +9,7 @@ "face": "JetBrainsMono Nerd Font Mono", "size": 11 }, + "startingDirectory": "%USERPROFILE%", "historySize": 10000, "padding": "8", "colorScheme": "Graphite Amber", @@ -22,12 +23,6 @@ "commandline": "powershell.exe", "hidden": false }, - { - "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", - "name": "PowerShell 7", - "commandline": "pwsh.exe", - "hidden": false - }, { "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "name": "Command Prompt", diff --git a/config/daily/vscodium/settings.json b/config/daily/vscodium/settings.json index 83263a5..f29b5fb 100644 --- a/config/daily/vscodium/settings.json +++ b/config/daily/vscodium/settings.json @@ -12,8 +12,10 @@ "extensions.autoCheckUpdates": false, "update.mode": "none", "update.showReleaseNotes": false, - "editor.fontFamily": "'JetBrains Mono', 'Cascadia Code', Consolas, monospace", + "editor.fontFamily": "JetBrainsMono Nerd Font Mono, Cascadia Mono, Consolas", "editor.fontSize": 13, + "workbench.colorTheme": "Graphite Amber", + "workbench.iconTheme": "vs-seti", "editor.fontLigatures": true, "editor.cursorSmoothCaretAnimation": "on", "editor.renderWhitespace": "boundary", @@ -41,6 +43,8 @@ "python.testing.pytestEnabled": true, "jupyter.askForKernelRestart": false, "terminal.integrated.defaultProfile.windows": "PowerShell", + "terminal.integrated.fontFamily": "JetBrainsMono Nerd Font Mono, Cascadia Mono, Consolas", + "terminal.integrated.fontSize": 12, "[python]": { "editor.defaultFormatter": "ms-python.python", "editor.tabSize": 4 diff --git a/config/vscodium/settings.json b/config/vscodium/settings.json index 09fe736..b799f06 100644 --- a/config/vscodium/settings.json +++ b/config/vscodium/settings.json @@ -53,27 +53,8 @@ }, "ruff.lineLength": 100, "notebook.formatOnSave.enabled": true, - "workbench.colorTheme": "Default Dark+", + "workbench.colorTheme": "Graphite Amber", "workbench.iconTheme": "vs-seti", - "workbench.colorCustomizations": { - "editor.background": "#16181D", - "editor.foreground": "#D8D3C8", - "editor.lineHighlightBackground": "#202329", - "editor.selectionBackground": "#3A352C", - "editorCursor.foreground": "#E8A33D", - "editorIndentGuide.background": "#30343B", - "editorIndentGuide.activeBackground": "#E8A33D", - "activityBar.activeBorder": "#E8A33D", - "sideBar.background": "#1B1D22", - "sideBar.foreground": "#D8D3C8", - "statusBar.background": "#202329", - "statusBar.foreground": "#D8D3C8", - "titleBar.activeBackground": "#16181D", - "titleBar.activeForeground": "#D8D3C8", - "terminal.background": "#16181D", - "terminal.foreground": "#D8D3C8", - "terminalCursor.foreground": "#E8A33D" - }, "workbench.startupEditor": "none", "workbench.enableExperiments": false, "workbench.tips.enabled": false, diff --git a/docs/APPS.md b/docs/APPS.md new file mode 100644 index 0000000..b4a4b94 --- /dev/null +++ b/docs/APPS.md @@ -0,0 +1,87 @@ +# desktop apps + +one inventory for the apps this repo installs or configures. config paths are +per-user. the installer never writes an app password or an API key into these +files. + +| app | profile | source | repo config | theme | +| --- | --- | --- | --- | --- | +| 7-Zip | daily, iot | `7zip.7zip` | none needed | native light | +| qBittorrent | iot | `qBittorrent.qBittorrent` | `qBittorrent/qbittorrent.ini` | native light | +| Windows Terminal | daily, iot | `Microsoft.WindowsTerminal` | `WindowsTerminal/settings.json` | Graphite Amber | +| VSCodium | daily, iot | `VSCodium.VSCodium` | `config/vscodium/settings.json`, `VSCodium/graphite-amber-theme/` | Graphite Amber | +| LibreWolf | daily, iot | `LibreWolf.LibreWolf` | `LibreWolf/librewolf.overrides.cfg` | native light | +| Vesktop | daily, iot | `Vencord.Vesktop` | `config/vesktop/settings.json`, `Vesktop/quickcss.css` | Graphite Amber | +| Mem Reduct | iot, optional | `Henry++.MemReduct` | `MemReduct/memreduct.ini` | native light | + +## 7-Zip + +Installed when `7z.exe` is absent. The IoT self-check also accepts +`C:\Program Files\7-Zip\7z.exe`, because 7-Zip does not always add `7z` to +`PATH`. No repo config; keep the shipped shell integration as-is. + +## qBittorrent + +`qBittorrent/qbittorrent.ini` is copied fresh-only to +`%APPDATA%\qBittorrent\qbittorrent.ini`. The shipped state is: + +- WebUI off; loopback address only if you turn it on locally. +- No web username or password hash in the repo. +- UPnP off; DHT, PeX, and Local Peer Discovery on. +- Downloads under `C:/Users/Public/Downloads`; queue 5 downloads and 5 uploads. + +If you enable WebUI by hand, set the password in the app. That value stays in +your user config and is not part of this repository. + +## Windows Terminal + +`WindowsTerminal/settings.json` is copied fresh-only by the IoT profile. The +daily theme module also maintains the Graphite Amber scheme and applies it to +terminal defaults. It keeps Windows PowerShell 5.1 and Command Prompt, removes +the stale PowerShell 7 profile, starts in `%USERPROFILE%`, and uses no acrylic +or transparency. + +## VSCodium + +Both profiles use the bundled `xfcemlg.graphite-amber-theme-0.6.0` extension. +The daily theme module installs it fresh-only; the IoT profile copies the +extension folder. `workbench.colorTheme` is set to `Graphite Amber` in both +settings templates. Telemetry is off and updates are manual. + +## LibreWolf + +LibreWolf is the browser in the IoT app list. The installer: + +- copies `librewolf.overrides.cfg` fresh-only to + `%USERPROFILE%\.librewolf\librewolf.overrides.cfg`; +- creates `personal`, `uni`, and `social` profiles under + `%APPDATA%\LibreWolf\Profiles`; +- adds Start Menu shortcuts that open each profile with `-P -no-remote`. + +The overrides file uses `defaultPref`, so UI changes win. It only sets startup +behavior and a close-tabs warning. Windows protects the default browser +choice, so set LibreWolf as default by hand in +`Settings > Apps > Default apps > Web browser`. + +## Vesktop + +Vesktop and Vencord settings are merged into +`%APPDATA%\vesktop\settings.json` and +`%APPDATA%\vesktop\settings\settings.json`. `Vesktop/quickcss.css` supplies the +Graphite Amber Quick CSS. Close Vesktop before changing these files; it +rewrites settings on exit. + +## Mem Reduct + +Optional IoT app, added only with `-IncludeOptional`. Winget ID is +`Henry++.MemReduct`. `memreduct.ini` is copied fresh-only to +`%APPDATA%\Henry++\Mem Reduct\memreduct.ini`. The repo file is comment-only so +Mem Reduct can write its own settings on first run. No autostart, no interval +cleanup, and no registry edits. It needs admin rights when you run it because +it uses Native APIs. + +## theme boundary + +Graphite Amber belongs in terminals, editors, and Vesktop. Engineering and +daily-use desktop apps keep their native light UI so TIA Portal, MATLAB, +ONLYOFFICE, dialogs, and file pickers stay readable. diff --git a/docs/CLI.md b/docs/CLI.md index 7c37ddf..f576ee0 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -1,17 +1,21 @@ # CLI contract -two front doors, two profiles. extra flags after `-Profile` pass through to the -profile script unchanged. +two front doors, two profiles. flags not declared on the front door pass through +to the profile script unchanged. | command | profile | target | | --- | --- | --- | | `Install.ps1 -Profile daily` | daily | `scripts/Install.ps1` | | `Install.ps1 -Profile iot` | iot | `install-Win-Iot.ps1` | -| `Validate.ps1 -Profile daily` | daily | `scripts/Validate.ps1` | +| `Install.ps1 -Profile daily -Verify` | daily | `Validate.ps1 -Profile daily` | +| `Install.ps1 -Profile iot -Verify` | iot | `Validate.ps1 -Profile iot` | +| `Install.ps1 -Profile daily -Status` | daily | saved daily state only | +| `Validate.ps1` | daily | `scripts/Validate.ps1` | | `Validate.ps1 -Profile iot` | iot | `install-Win-Iot.ps1 -Verify` | -`Setup.cmd` always starts the IoT script with `-Unattended` before any extra -flags you pass. +`Install.ps1 -Verify` is an alias for the matching validator. Neither validation +path writes settings, state, logs, transcripts, or reports. `Setup.cmd` always +starts the IoT script with `-Unattended` before any extra flags you pass. ## common flags @@ -19,8 +23,9 @@ flags you pass. | --- | --- | --- | --- | | `-DryRun` | yes | yes | plan without applying system changes | | `-Only` | module names | app ID patterns | filters work | -| `-Force` | yes | yes | rerun skipped work | -| `-Verify` | via `Validate.ps1` | yes | read-only state check | +| `-Force` | yes | yes | rerun skipped work and overwrite managed files | +| `-Verify` | yes | yes | read-only state check through the front door | +| `-Status` | yes | no | print saved state and the next command | | `-Resume` | yes | no | continue after a pending reboot | | `-ConfigsOnly` | no | yes | copy configs only | | `-OfflineDir` | no | yes | staged install source | @@ -29,37 +34,42 @@ flags you pass. daily `-Only` accepts `preflight`, `os`, `packages`, `apps`, `engineering`, `developer`, `omniroute`, `theme`, `configs`, `validate`, or `all`. -iot `-Only` and `-SkipApps` match app IDs as substrings. they do not gate +iot `-Only` and `-SkipApps` match app IDs as substrings. They do not gate configs, drivers, repairs, or other phases. ## order and state -daily module load order is alphabetical from `scripts/modules/`. run order is +daily module load order is alphabetical from `scripts/modules/`. Run order is fixed in `scripts/Install.ps1`: ```text preflight os packages apps engineering developer omniroute theme configs validate ``` -daily state lives in `%LOCALAPPDATA%\win11-stack\state.json`. iot state lives -under the `StateDir` path and uses `phases.json` plus `apps.json`. the two state +Daily state lives in `%LOCALAPPDATA%\win11-stack\state.json`. IoT state lives +under the `StateDir` path and uses `phases.json` plus `apps.json`. The two state systems are separate by design. -dry-run does not write state. it still writes logs and, for iot, a report JSON. +Dry-run does not write state. Daily still writes its log and transcript. IoT +also writes a report JSON. A real run prints a summary with `ok`, `skip`, `warn`, +and `fail` counts, then the next command. A module can mark itself failed; that +sets the exit code and stops the run from claiming the module completed. ## exit codes - `0` means the checked path completed without a hard failure. - `1` means at least one real check failed. - a nonzero child exit code is propagated by both front doors. +- the UAC relaunch waits for the elevated child and returns its exit code. -host-only misses such as a missing Defender service, S7 firewall rule, or font -are real `FAIL` results on this machine. they are reported, not repaired. +Host-only misses such as a missing Defender service, S7 firewall rule, or font +are real `FAIL` results on this machine. They are reported, not repaired. Defender preferences are never written by this repo. ## safety notes -- `OMNIROUTE_API_KEY` is read from the environment only. it is never written to a file. +- `OMNIROUTE_API_KEY` is read from the environment only. It is never written to a file. - dry-run skips the execution policy write. -- IoT `-Verify` writes a log directory and transcript before the read-only check. +- IoT log, state, transcript, and report setup happens after `-Verify`, so the read-only path writes nothing. +- LibreWolf default browser is a manual Windows UserChoice step. - no published tag is moved by installer runs. diff --git a/docs/RESEARCH.md b/docs/RESEARCH.md index 6114d54..3e100b3 100644 --- a/docs/RESEARCH.md +++ b/docs/RESEARCH.md @@ -68,8 +68,11 @@ scans, and exclusions untouched. - KeePassXC for the vault. The script creates the folder, never a database. - LibreWolf profiles `personal`, `uni`, and `social`, each with its own cookie jar and sign-in. LibreWolf is already hardened; the script does not add - prefs that could break sites. Ungoogled Chromium is a valid alternative, but - LibreWolf's profile isolation and update path are simpler on Windows. + prefs that could break sites. The `librewolf.overrides.cfg` file uses + `defaultPref`, so UI choices win. Windows 11 protects the default browser + `UserChoice`; the installer prints the Settings step instead of forcing it. + Ungoogled Chromium is a valid alternative, but LibreWolf's profile isolation + and update path are simpler on Windows. - GitHub CLI uses SSH for Git; its other defaults stay as shipped. ## Desktop apps @@ -83,6 +86,22 @@ scans, and exclusions untouched. because it rewrites settings on exit. - ONLYOFFICE default associations cannot be set silently. Windows 11 protects `UserChoice`; set them by hand in Settings. +- qBittorrent ships with WebUI off, UPnP off, no web password in the repo, and a + loopback address only for a local opt-in. Configure a password in the app if + WebUI is enabled; the repository never stores one. +- 7-Zip is checked at `C:\Program Files\7-Zip\7z.exe` as well as on `PATH`. + Some installers do not add `7z` to the shell path. +- Windows Terminal keeps stock Windows PowerShell 5.1 and Command Prompt. The + old PowerShell 7 entry was stale on IoT images that never install `pwsh`. + +## Mem Reduct + +`Henry++.MemReduct` is optional because it needs admin rights and uses native +memory APIs. The upstream source exposes settings such as `AutoreductEnable`, +`AutoreductIntervalEnable`, `TrayLevelWarning`, and `TrayLevelDanger`. The repo +does not guess values. It ships a comment-only `memreduct.ini` in the portable +folder and lets the app write its own settings on first run. No autostart or +scheduled cleanup is configured. ## FOSS replacements diff --git a/docs/RUNBOOK.md b/docs/RUNBOOK.md index 51f4531..0fbec3a 100644 --- a/docs/RUNBOOK.md +++ b/docs/RUNBOOK.md @@ -4,34 +4,38 @@ ```powershell cd path\to\win11-engineering-stack -.\scripts\Install.ps1 -DryRun -.\scripts\Install.ps1 +.\Install.ps1 -Profile daily -DryRun +.\Install.ps1 -Profile daily ``` The script elevates itself once. If a reboot is required, it stops and prints the resume command. Run it after the reboot: ```powershell -.\scripts\Install.ps1 -Resume +.\Install.ps1 -Profile daily -Resume ``` ## Common invocations ```powershell # OS features only, with the ISO payload. -.\scripts\Install.ps1 -Only os -SxsPath D:\sources\sxs +.\Install.ps1 -Profile daily -Only os -SxsPath D:\sources\sxs # Apps and editor extensions. -.\scripts\Install.ps1 -Only apps +.\Install.ps1 -Profile daily -Only apps # Engineering folders, MATLAB env, installer launch. -.\scripts\Install.ps1 -Only engineering -TiaInstaller D:\TIA\Start.exe -MatlabInstaller D:\MATLAB\setup.exe +.\Install.ps1 -Profile daily -Only engineering -TiaInstaller D:\TIA\Start.exe -MatlabInstaller D:\MATLAB\setup.exe # Theme and configs only. -.\scripts\Install.ps1 -Only theme,configs +.\Install.ps1 -Profile daily -Only theme,configs -# Read-only report. -.\scripts\Validate.ps1 +# Saved daily state and the next command. +.\Install.ps1 -Profile daily -Status + +# Read-only reports. both are write-free. +.\Validate.ps1 +.\Validate.ps1 -Profile iot ``` ## What is manual @@ -43,14 +47,18 @@ resume command. Run it after the reboot: `MATLABROOT` and `PATH` after the install. 3. **ONLYOFFICE defaults**: Settings -> Apps -> Default apps -> ONLYOFFICE for `.docx`, `.xlsx`, `.pptx`. -4. **LibreWolf**: open each profile shortcut and sign in separately. -5. **KeePassXC**: create the database in `Documents\Vaults`. -6. **OmniRoute**: open `http://127.0.0.1:20128/dashboard`, connect providers, and +4. **LibreWolf**: open each profile shortcut and sign in separately. Set it as + default in Settings -> Apps -> Default apps -> Web browser. Windows protects + that choice, so the script only prints the step. +5. **qBittorrent**: WebUI ships off. If you turn it on in the app, set a local + password there; no password is stored in the repo. +6. **KeePassXC**: create the database in `Documents\Vaults`. +7. **OmniRoute**: open `http://127.0.0.1:20128/dashboard`, connect providers, and confirm `OMNIROUTE_API_KEY` is a user environment variable. The installer also sets `OMNIROUTE_SERVER_HOST=127.0.0.1` and `REQUIRE_API_KEY=true`. -7. **GitHub**: `gh auth login` if needed, then +8. **GitHub**: `gh auth login` if needed, then `gh ssh-key add $HOME\.ssh\id_ed25519.pub`. -8. **Reboot or sign out** once after the theme module so Windows applies the +9. **Reboot or sign out** once after the theme module so Windows applies the light mode and accent. ## Troubleshooting @@ -121,8 +129,9 @@ Rerun `.\scripts\Install.ps1 -Only engineering` after installing MATLAB. It sets ### LibreWolf profile creation fails -Close every LibreWolf window, then rerun `-Only developer`. The profile name must -not already exist in `%APPDATA%\LibreWolf\profiles.ini`. +Close every LibreWolf window, then rerun `.\Install.ps1 -Profile daily -Only +developer`. On IoT, rerun `install-Win-Iot.ps1 -ConfigsOnly`. The profile name +must not already exist in `%APPDATA%\LibreWolf\profiles.ini`. ## Rollback diff --git a/install-Win-Iot.ps1 b/install-Win-Iot.ps1 index 729775a..fc0d027 100644 --- a/install-Win-Iot.ps1 +++ b/install-Win-Iot.ps1 @@ -3,7 +3,7 @@ My Win10/Win11 IoT (Enterprise) LTSC setup. Unattended, rerunnable. .DESCRIPTION Built for a tiny10 box with no store and usually no network - on first boot. PS 5.1, stock Windows desktop, Helium, VSCodium. + on first boot. PS 5.1, stock Windows desktop, LibreWolf, VSCodium. No extra shell, no extra window manager. Stock colors everywhere. Engines per app, first hit wins: staged -OfflineDir files, winget, github releases, direct vendor URLs. Log lands in C:\Windows\Logs\Win-Iot-Setup @@ -46,15 +46,7 @@ Set-StrictMode -Version 2 $Repo = Split-Path $MyInvocation.MyCommand.Path -Parent # -ConfigsOnly re-deploys user configs (VSCodium, Vesktop, qBittorrent, opencode, # terminal, ...) and nothing else. install phases are gated below. -$Stamp = Get-Date -Format 'yyyyMMdd-HHmmss' -# C:\Windows\Logs needs admin. non-admin runs fall back to TEMP instead of dying. -try { New-Item -ItemType Directory -Force -Path $LogDir -EA Stop | Out-Null } -catch { $LogDir = Join-Path $env:TEMP 'Win-Iot-Setup'; New-Item -ItemType Directory -Force -Path $LogDir -EA SilentlyContinue | Out-Null } -# non-admin runs land in TEMP, so the state dir follows the log dir there. -if ($StateDir -eq 'C:\Windows\Logs\Win-Iot-Setup\state' -and $LogDir -ne 'C:\Windows\Logs\Win-Iot-Setup') { $StateDir = Join-Path $LogDir 'state' } -$LogFile = Join-Path $LogDir "install-$Stamp.log" -$transcriptOn = $false -try { Start-Transcript -Path $LogFile -Force -EA Stop | Out-Null; $transcriptOn = $true } catch {} +# log, state, and transcript start after -Verify, so the read-only path writes nothing. # warn count lands in the run report. it is the number a tired human reads first. $script:warnCount = 0 function Log($m) { @@ -277,10 +269,19 @@ if ($Verify) { } else { Log ' skip: OmniRoute is not listening yet' } if ($miss) { Log "Verify: $miss thing(s) missing." } else { Log 'Verify: all good.' } - if ($transcriptOn) { try { Stop-Transcript | Out-Null } catch {} } exit $(if ($miss) { 1 } else { 0 }) } +$Stamp = Get-Date -Format 'yyyyMMdd-HHmmss' +# C:\Windows\Logs needs admin. non-admin runs fall back to TEMP instead of dying. +try { New-Item -ItemType Directory -Force -Path $LogDir -EA Stop | Out-Null } +catch { $LogDir = Join-Path $env:TEMP 'Win-Iot-Setup'; New-Item -ItemType Directory -Force -Path $LogDir -EA SilentlyContinue | Out-Null } +# non-admin runs land in TEMP, so the state dir follows the log dir there. +if ($StateDir -eq 'C:\Windows\Logs\Win-Iot-Setup\state' -and $LogDir -ne 'C:\Windows\Logs\Win-Iot-Setup') { $StateDir = Join-Path $LogDir 'state' } +$LogFile = Join-Path $LogDir "install-$Stamp.log" +$transcriptOn = $false +try { Start-Transcript -Path $LogFile -Force -EA Stop | Out-Null; $transcriptOn = $true } catch {} + # one-shot Win-Iot-Setup task already fired. remove it so it never refires. if ($DryRun) { Log ' [dry-run] would remove the one-shot Win-Iot-Setup scheduled task.' } else { try { Unregister-ScheduledTask -TaskName 'Win-Iot-Setup' -Confirm:$false -EA Stop } catch {} } @@ -537,7 +538,6 @@ if (-not $ConfigsOnly) { # ---------- 2a. github-direct. no package manager, straight off release pages. ---------- # patterns verified against the live releases api. x64 only, this box is x64. -# helium has no assets on its releases page, so it stays staged-only. # unauthenticated api = 60 calls/hr, this runs max 9 per pass. cached under TEMP # so re-runs skip the download. $gitMap = @{ @@ -653,7 +653,7 @@ if (-not $ConfigsOnly) { } # 4.8 is already in the image. moving on. $coreApps = @( - 'ImputNet.Helium', + 'LibreWolf.LibreWolf', 'VSCodium.VSCodium', 'Vencord.Vesktop', 'Telegram.TelegramDesktop', @@ -680,7 +680,7 @@ $shellApps = @( 'Fastfetch-cli.Fastfetch' ) $coreApps += $shellApps -$optionalApps = @('Obsidian.Obsidian','Spotify.Spotify') +$optionalApps = @('Obsidian.Obsidian','Spotify.Spotify','Henry++.MemReduct') if ($IncludeOptional) { $coreApps += $optionalApps } # terminal wants win10 1903+. on ltsc 2019 it would just fail every run. $wtBuild = 0 @@ -987,6 +987,64 @@ if (-not $ConfigsOnly) { } } else { Log ' python libs skipped (configs-only).' } +function New-IotShortcut { + param( + [Parameter(Mandatory = $true)][string]$Path, + [Parameter(Mandatory = $true)][string]$Target, + [string]$Arguments = '' + ) + if ($DryRun) { Log " [dry-run] would create shortcut: $Path"; return } + $dir = Split-Path $Path + if (-not (Test-Path $dir)) { New-Item -ItemType Directory -Force -Path $dir | Out-Null } + $shell = New-Object -ComObject WScript.Shell + $lnk = $shell.CreateShortcut($Path) + $lnk.TargetPath = $Target + $lnk.Arguments = $Arguments + $lnk.IconLocation = $Target + $lnk.Save() + Log " shortcut: $Path" +} + +function Get-LibreWolfPathIot { + $candidates = @( + 'C:\Program Files\LibreWolf\librewolf.exe', + (Join-Path $env:LOCALAPPDATA 'LibreWolf\librewolf.exe'), + (Get-CmdPath 'librewolf') + ) + foreach ($candidate in $candidates) { + if ($candidate -and (Test-Path $candidate)) { return $candidate } + } + return $null +} + +function Set-LibreWolfProfilesIot { + $lw = Get-LibreWolfPathIot + if (-not $lw) { Log ' LibreWolf not found yet - profiles skipped.'; return } + + $dataRoot = Join-Path $env:APPDATA 'LibreWolf' + $profilesRoot = Join-Path $dataRoot 'Profiles' + $iniPath = Join-Path $dataRoot 'profiles.ini' + $existing = '' + if (Test-Path $iniPath) { $existing = Get-Content $iniPath -Raw } + $shortcutFolder = Join-Path $env:APPDATA 'Microsoft\Windows\Start Menu\Programs\LibreWolf Profiles' + + if (-not $DryRun -and -not (Test-Path $profilesRoot)) { New-Item -ItemType Directory -Force -Path $profilesRoot | Out-Null } + + foreach ($profile in @('personal', 'uni', 'social')) { + $profilePath = Join-Path $profilesRoot $profile + $known = $existing -match ('(?m)^Name=' + [regex]::Escape($profile) + '\r?$') + if ($known -and (Test-Path $profilePath)) { Log " profile exists: $profile"; continue } + if ($DryRun) { Log " [dry-run] would create LibreWolf profile $profile at $profilePath" } + else { + $code = Invoke-Native { & $lw '-CreateProfile' "$profile $profilePath" } + if ($code -eq 0) { Log " profile: $profile" } else { Log " WARN profile ${profile}: exit $code" } + } + $shortcut = Join-Path $shortcutFolder "$profile.lnk" + if (Test-Path $shortcut) { Log " shortcut exists: $shortcut" } + else { New-IotShortcut -Path $shortcut -Target $lw -Arguments "-P `"$profile`" -no-remote" } + } +} + # fresh installs get configs; -ConfigsOnly (or -Force) re-deploys over existing ones. function Copy-Fresh($src, $dst) { if (($ConfigsOnly -or $Force) -or -not (Test-Path $dst)) { Copy-Config $src $dst } @@ -1021,11 +1079,11 @@ if (Test-Path $ocSkillSrc) { if ($wtOk) { Copy-Fresh (Join-Path $Repo 'WindowsTerminal\settings.json') (Join-Path $env:LOCALAPPDATA 'Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json') } $ocPlugins = Join-Path $env:USERPROFILE '.config\opencode\plugins' if (-not $DryRun -and -not (Test-Path $ocPlugins)) { New-Item -ItemType Directory -Force -Path $ocPlugins | Out-Null } -if (Test-Path (Join-Path $Repo 'Helium\master_preferences')) { - $heData = Join-Path $env:LOCALAPPDATA 'Helium\User Data' - if (-not (Test-Path $heData)) { Copy-Config (Join-Path $Repo 'Helium\master_preferences') (Join-Path $heData 'master_preferences') } - else { Log ' Helium already ran - master_preferences ignored (change settings in UI).' } -} +# librewolf: safe defaults plus three isolated profiles. fresh-only overrides. +Copy-Fresh (Join-Path $Repo 'LibreWolf\librewolf.overrides.cfg') (Join-Path $env:USERPROFILE '.librewolf\librewolf.overrides.cfg') +Set-LibreWolfProfilesIot +# mem reduct: repo ships a comment-only ini so the app has a stable config file. +Copy-Fresh (Join-Path $Repo 'MemReduct\memreduct.ini') (Join-Path $env:APPDATA 'Henry++\Mem Reduct\memreduct.ini') # drop your .ttfs in Fonts/ and they get installed. admin only, windows rules. $fontDir = Join-Path $Repo 'Fonts' @@ -1050,22 +1108,9 @@ Complete-Phase 'configs' if ((-not $ConfigsOnly) -and (Should-Run 'autostart')) { Log 'Autostart...' Start-Phase 'autostart' -# helium default. per-user, needs no admin. -if ($DryRun) { Log ' [dry-run] would set Helium as default browser.' } -else { -try { - $helium = Get-CmdPath 'helium' - if (-not $helium) { - foreach ($root in @("$env:LOCALAPPDATA\Helium", "$env:ProgramFiles\Helium", "${env:ProgramFiles(x86)}\Helium")) { - if (-not (Test-Path $root)) { continue } - $h = Get-ChildItem $root -Filter 'helium.exe' -Recurse -EA SilentlyContinue | Select-Object -First 1 - if ($h) { $helium = $h.FullName; break } - } - } - if ($helium) { Start-Process $helium -ArgumentList '--make-default-browser' -WindowStyle Hidden -EA Stop; Log ' Helium default-browser requested (confirm in Settings > Apps > Default apps).' } - else { Log ' Helium not found yet - set default manually in Settings > Apps > Default apps.' } -} catch { Log " WARN default browser: $_" } -} +# default browser is a Windows UserChoice action. print the step, never force it. +if ($DryRun) { Log ' [dry-run] would print the LibreWolf default-browser step.' } +else { Log ' set LibreWolf as default browser in Settings > Apps > Default apps.' } # auth can't run unattended, so it goes on the desktop as a double-click thing. if ($DryRun) { Log ' [dry-run] would write Desktop Win-Iot-Finish.cmd.' } @@ -1095,7 +1140,7 @@ if (-not $ConfigsOnly) { @{ n='node'; cmd={ node --version } }, @{ n='codium'; cmd={ & (Get-CmdPath 'codium') --version } }, @{ n='opencode'; cmd={ opencode --version } }, - @{ n='7zip'; cmd={ Get-Command 7z -EA Stop | Out-Null } } + @{ n='7zip'; cmd={ if (-not (Get-Command 7z -EA SilentlyContinue) -and -not (Test-Path 'C:\Program Files\7-Zip\7z.exe')) { throw '7-Zip not found' } } } )) { if ((Invoke-Native $s.cmd) -eq 0) { Log " smoke ok: $($s.n)" } else { Log " smoke MISSING: $($s.n)" } @@ -1148,6 +1193,7 @@ Log 'NEXT:' Log ' 1. reboot, stock desktop as-is.' Log ' 2. double-click Desktop Win-Iot-Finish.cmd (opencode auth + optional password).' Log ' 3. MATLAB via campus license + USB-serial drivers (CH340/CP210x/ST-Link) manually.' +Log ' 4. set LibreWolf as default browser in Settings > Apps > Default apps.' } if ($Reboot -and -not $DryRun) { Log 'rebooting in 60s (-Reboot). save your stuff.' diff --git a/qBittorrent/README.md b/qBittorrent/README.md index 4e8976e..16f38fd 100644 --- a/qBittorrent/README.md +++ b/qBittorrent/README.md @@ -1,21 +1,25 @@ -# qBittorrent -Fresh installs only, `%APPDATA%\qBittorrent\qbittorrent.ini`. -- Change save path: Tools > Preferences > Downloads (staged default is - `C:/Users/Public/Downloads` - edit the ini or the UI before downloading). -- WebUI on `:8080` (admin/admin - change it: Tools > Preferences > Web UI). -- Dark look: Tools > Preferences > Behavior > dark is automatic on dark - Windows; for a red accent grab any red/black `.qbtheme` and load it under - Tools > Preferences > Behavior > Use custom UI theme. -- Park it on ws8 (`Win+8`) with OBS and VLC. Media corner. -- Search without browser tabs: View > check Search engine, then Search tab > - Search plugins > Check for updates. Ships eztv, piratebay, limetorrents, - solidtorrents and friends. Needs Python - already installed by the setup. - Jackett shows up too but wants its API key; that means running Jackett - itself somewhere. Skip it unless you go down that hole. -- Speed + privacy, from people who benchmark this stuff: BitTorrent tab, - DHT and Peer Exchange ON, Local Peer Discovery OFF (unless campus LAN), - encryption Allow (Require only if you accept fewer peers), port somewhere - 49160-65534 forwarded on your router, queue 4-6 active. Anonymous mode - hides metadata but breaks private trackers - publics only. Disk cache: - leave Auto unless it stutters, then try 512. Status bar: right-click it, - show external IP, so you know what the swarm sees. +# qBittorrent + +Fresh installs only. The staged file lands at +`%APPDATA%\qBittorrent\qbittorrent.ini`. Existing user settings are kept. + +## shipped state + +- WebUI off. The address is loopback only if you enable it locally. +- No web username or password hash in this repo. Set a password in the app if + you turn WebUI on; it stays in your user config. +- Save path `C:/Users/Public/Downloads`. Change it here or in Preferences before + starting a download. +- UPnP off. DHT, Peer Exchange, and Local Peer Discovery on. +- Queue 5 active downloads and 5 active uploads. +- Native light UI. No custom theme or dark injection. + +## notes + +- If WebUI is on, bind it to `127.0.0.1` and use a strong local password. Do not + forward port 8080 to the LAN. +- Encryption, port forwarding, disk cache, and anonymous mode are left at your + discretion. Anonymous mode breaks private trackers; use it for public swarms + only. +- Search plugins need Python, which the daily profile installs. Check for plugin + updates inside the app when you actually use the Search tab. diff --git a/qBittorrent/qbittorrent.ini b/qBittorrent/qbittorrent.ini index f2ff1dc..79a07b2 100644 --- a/qBittorrent/qbittorrent.ini +++ b/qBittorrent/qbittorrent.ini @@ -1,17 +1,16 @@ -[General] -Locale=en - -[Preferences] -Downloads\SavePath=C:/Users/Public/Downloads -Downloads\TempPathEnabled=false -WebUI\Enabled=true -WebUI\Port=8080 -WebUI\Username=admin -WebUI\Address=127.0.0.1 -Queueing\MaxActiveDownloads=5 -Queueing\MaxActiveUploads=5 -Connection\UPnP=true -BitTorrent\DHT=true -BitTorrent\PeX=true -BitTorrent\LSD=true -Downloads\PreAllocation=true +[General] +Locale=en + +[Preferences] +Downloads\SavePath=C:/Users/Public/Downloads +Downloads\TempPathEnabled=false +Downloads\PreAllocation=true +Queueing\MaxActiveDownloads=5 +Queueing\MaxActiveUploads=5 +Connection\UPnP=false +BitTorrent\DHT=true +BitTorrent\PeX=true +BitTorrent\LSD=true +WebUI\Enabled=false +WebUI\Address=127.0.0.1 +WebUI\Port=8080 diff --git a/scripts/Install.ps1 b/scripts/Install.ps1 index c3ad2be..714f982 100644 --- a/scripts/Install.ps1 +++ b/scripts/Install.ps1 @@ -7,6 +7,9 @@ Modular, idempotent setup for TIA Portal prerequisites, MATLAB paths, VSCodium, Git/gh, developer tools, OmniRoute, and OpenCode. +.PARAMETER Status + Print saved module state and the next command. Reads state only. + .PARAMETER DryRun Print every action without changing files, registry, services, or packages. @@ -37,6 +40,7 @@ #> [CmdletBinding()] param( + [switch]$Status, [switch]$DryRun, [string[]]$Only = @(), [switch]$Resume, @@ -54,6 +58,27 @@ $ErrorActionPreference = 'Stop' $libPath = Join-Path $PSScriptRoot 'lib\Common.ps1' . $libPath +if ($Status) { + $statusState = Get-StackState + $statusOrder = @('preflight', 'os', 'packages', 'apps', 'engineering', 'developer', 'omniroute', 'theme', 'configs', 'validate') + $statusDone = @($statusState.Completed) + $statusTodo = @($statusOrder | Where-Object { $statusDone -notcontains $_ }) + Write-Host 'win11-engineering-stack status' + Write-Host " state: $script:StatePath" + Write-Host " last: $(if ($statusState.LastRun) { $statusState.LastRun } else { 'never' })" + Write-Host " reboot: $($statusState.PendingReboot)" + Write-Host " done: $(if ($statusDone.Count) { $statusDone -join ', ' } else { 'none' })" + Write-Host " todo: $(if ($statusTodo.Count) { $statusTodo -join ', ' } else { 'none' })" + if ($statusState.PendingReboot) { + Write-Host ' next: reboot, then .\Install.ps1 -Resume' + } + else { + Write-Host ' next: .\Validate.ps1 -Profile daily' + } + return +} + +Reset-WriteCounts $script:DryRun = [bool]$DryRun $script:Force = [bool]$Force $script:SxsPath = $SxsPath @@ -93,7 +118,10 @@ if ($needsAdmin) { if ($MatlabInstaller) { $arguments += @('-MatlabInstaller', (& $quote $MatlabInstaller)) } $hostExe = (Get-Process -Id $PID).Path - Start-Process -FilePath $hostExe -Verb RunAs -ArgumentList ($arguments -join ' ') + $child = Start-Process -FilePath $hostExe -Verb RunAs -ArgumentList ($arguments -join ' ') -Wait -PassThru + if ($null -ne $child.ExitCode) { + exit $child.ExitCode + } return } @@ -183,9 +211,14 @@ try { throw "Module function $functionName is missing. Check scripts\modules." } + $script:ModuleFailed = $false & $functionName - if (-not $DryRun) { + if ($script:ModuleFailed) { + $failed = $true + Write-Fail "module '$name' reported failure." + } + elseif (-not $DryRun) { if ($state.Completed -notcontains $name) { $state.Completed += $name } @@ -216,6 +249,13 @@ finally { $elapsed = (Get-Date) - $startedAt Write-Host '' Write-Host ("Finished in {0:mm\:ss}" -f $elapsed) -ForegroundColor White + Write-WriteSummary + if ($state.PendingReboot -and -not $DryRun) { + Write-Host ' next: .\Install.ps1 -Resume' -ForegroundColor Yellow + } + else { + Write-Host ' next: .\Validate.ps1 -Profile daily' -ForegroundColor Yellow + } if ($transcript) { Stop-Transcript | Out-Null } } diff --git a/scripts/lib/Common.ps1 b/scripts/lib/Common.ps1 index deee9c6..670ac9a 100644 --- a/scripts/lib/Common.ps1 +++ b/scripts/lib/Common.ps1 @@ -15,6 +15,11 @@ if (-not (Get-Variable -Name Force -Scope Script -ErrorAction SilentlyContinue)) } $script:BackupSession = $null $script:BackedUp = @{} +$script:CountOk = 0 +$script:CountSkip = 0 +$script:CountWarn = 0 +$script:CountFail = 0 +$script:ModuleFailed = $false function Write-Step { param([string]$Message) @@ -29,24 +34,44 @@ function Write-Detail { function Write-Ok { param([string]$Message) + $script:CountOk = $script:CountOk + 1 Write-Host " [ok] $Message" -ForegroundColor Green } function Write-Skip { param([string]$Message) + $script:CountSkip = $script:CountSkip + 1 Write-Host " [skip] $Message" -ForegroundColor Yellow } function Write-Warn { param([string]$Message) + $script:CountWarn = $script:CountWarn + 1 Write-Host " [warn] $Message" -ForegroundColor Yellow } function Write-Fail { param([string]$Message) + $script:CountFail = $script:CountFail + 1 Write-Host " [fail] $Message" -ForegroundColor Red } +function Reset-WriteCounts { + $script:CountOk = 0 + $script:CountSkip = 0 + $script:CountWarn = 0 + $script:CountFail = 0 + $script:ModuleFailed = $false +} + +function Write-WriteSummary { + Write-Host ("summary: ok {0}, skip {1}, warn {2}, fail {3}" -f $script:CountOk, $script:CountSkip, $script:CountWarn, $script:CountFail) -ForegroundColor White +} + +function Set-ModuleFailed { + $script:ModuleFailed = $true +} + function Test-Admin { $identity = [Security.Principal.WindowsIdentity]::GetCurrent() $principal = New-Object Security.Principal.WindowsPrincipal($identity) diff --git a/scripts/modules/10-OS.ps1 b/scripts/modules/10-OS.ps1 index ba48213..e38a25d 100644 --- a/scripts/modules/10-OS.ps1 +++ b/scripts/modules/10-OS.ps1 @@ -42,6 +42,7 @@ function Enable-OptionalFeatureSafe { } catch { Write-Fail "$Name could not be enabled: $($_.Exception.Message)" + Set-ModuleFailed return $false } } diff --git a/scripts/modules/45-Developer.ps1 b/scripts/modules/45-Developer.ps1 index 73d45bc..5646733 100644 --- a/scripts/modules/45-Developer.ps1 +++ b/scripts/modules/45-Developer.ps1 @@ -154,8 +154,14 @@ function Set-LibreWolfProfiles { Write-Detail "[dry-run] create LibreWolf profile $profile at $profilePath" } else { - Invoke-External -FilePath $librewolf -ArgumentList @('-CreateProfile', "$profile $profilePath") -AllowFailure | Out-Null - Write-Ok "LibreWolf profile: $profile" + $code = Invoke-External -FilePath $librewolf -ArgumentList @('-CreateProfile', "$profile $profilePath") -AllowFailure + if ($code -eq 0) { + Write-Ok "LibreWolf profile: $profile" + } + else { + Write-Fail "LibreWolf profile ${profile}: exit $code" + Set-ModuleFailed + } } $shortcut = Join-Path $shortcutFolder "$profile.lnk" diff --git a/scripts/modules/60-OmniRoute.ps1 b/scripts/modules/60-OmniRoute.ps1 index 80eeb80..28dc19c 100644 --- a/scripts/modules/60-OmniRoute.ps1 +++ b/scripts/modules/60-OmniRoute.ps1 @@ -108,6 +108,7 @@ function Invoke-OmniRoute { $npm = Get-CommandPath 'npm' if (-not $node -or -not $npm) { Write-Fail 'Node.js and npm are required for OmniRoute.' + Set-ModuleFailed return } Write-Detail "node: $((& node --version 2>$null) -join '')" @@ -123,6 +124,7 @@ function Invoke-OmniRoute { $code = Invoke-External -FilePath 'npm' -ArgumentList @('install', '-g', 'omniroute') -AllowFailure if ($code -ne 0) { Write-Fail 'OmniRoute installation failed.' + Set-ModuleFailed return } $cli = Get-CommandPath 'omniroute.cmd' diff --git a/scripts/modules/70-Theme.ps1 b/scripts/modules/70-Theme.ps1 index b657e46..17111d6 100644 --- a/scripts/modules/70-Theme.ps1 +++ b/scripts/modules/70-Theme.ps1 @@ -63,11 +63,15 @@ function Set-TerminalTheme { face = 'JetBrainsMono Nerd Font Mono' size = 11 } + $defaults['startingDirectory'] = '%USERPROFILE%' $defaults['colorScheme'] = 'Graphite Amber' $defaults['useAcrylic'] = $false $defaults['opacity'] = 100 $profiles['defaults'] = $defaults $settings['profiles'] = $profiles + if (-not $settings.ContainsKey('defaultProfile')) { + $settings['defaultProfile'] = '{61c54bbd-c2c6-5271-96e7-009a87ff44bf}' + } $settings['theme'] = 'dark' Write-JsonFile -Path $path -Value $settings -NoMerge @@ -75,6 +79,28 @@ function Set-TerminalTheme { else { Write-Ok "terminal theme applied: $path" } } +function Install-VSCodiumTheme { + $source = Join-Path $script:RepoRoot 'VSCodium\graphite-amber-theme' + if (-not (Test-Path $source)) { + Write-Warn "VSCodium theme folder missing: $source" + return + } + + $target = Join-Path $env:USERPROFILE '.vscode-oss\extensions\xfcemlg.graphite-amber-theme-0.6.0' + if (Test-Path $target) { + Write-Skip "VSCodium Graphite Amber theme exists: $target" + return + } + if ($script:DryRun) { + Write-Detail "[dry-run] install VSCodium Graphite Amber theme: $target" + return + } + + New-Item -ItemType Directory -Path $target -Force | Out-Null + Get-ChildItem -LiteralPath $source | Copy-Item -Destination $target -Recurse -Force + Write-Ok "VSCodium Graphite Amber theme installed: $target" +} + function Set-WindowsTheme { $personalize = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize' Set-RegistryValue -Path $personalize -Name 'AppsUseLightTheme' -Value 1 -Type DWord @@ -127,6 +153,7 @@ function Invoke-Theme { } Set-TerminalTheme + Install-VSCodiumTheme Set-PowerShellProfile Write-Detail 'Windows UI changes apply at the next sign-in.' diff --git a/scripts/modules/80-Configs.ps1 b/scripts/modules/80-Configs.ps1 index 7561733..6be9708 100644 --- a/scripts/modules/80-Configs.ps1 +++ b/scripts/modules/80-Configs.ps1 @@ -24,6 +24,28 @@ function Set-VSCodiumConfig { else { Write-Ok "VSCodium settings merged: $target" } } +function Set-LibreWolfConfig { + $source = Join-Path $script:RepoRoot 'LibreWolf\librewolf.overrides.cfg' + if (-not (Test-Path $source)) { + Write-Warn "LibreWolf overrides template missing: $source" + return + } + + $target = Join-Path $env:USERPROFILE '.librewolf\librewolf.overrides.cfg' + if (Test-Path $target) { + Write-Skip "LibreWolf overrides kept: $target" + return + } + if ($script:DryRun) { + Write-Detail "[dry-run] LibreWolf overrides would be written: $target" + return + } + + New-Item -ItemType Directory -Path (Split-Path $target) -Force | Out-Null + Copy-Item -LiteralPath $source -Destination $target -Force + Write-Ok "LibreWolf overrides written: $target" +} + function Set-OpenCodeConfig { $source = Join-Path $script:ConfigRoot 'opencode\opencode.json' if (-not (Test-Path $source)) { @@ -95,11 +117,12 @@ function Set-VesktopConfig { } function Invoke-Configs { - Write-Step 'Configs: editor, OpenCode, Vesktop' + Write-Step 'Configs: editor, OpenCode, Vesktop, LibreWolf' Set-VSCodiumConfig Set-OpenCodeConfig Set-VesktopConfig + Set-LibreWolfConfig Write-Detail 'Config backups:' if ($script:BackupSession) {