Skip to content

feat: hand the Windows office install to the user as a right-click .cmd - #244

Merged
quickbeard merged 2 commits into
mainfrom
feat/windows-manual-installer-handoff
Aug 5, 2026
Merged

feat: hand the Windows office install to the user as a right-click .cmd#244
quickbeard merged 2 commits into
mainfrom
feat/windows-manual-installer-handoff

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

Summary

Closes out the silent-death investigation on Windows with a controlled field experiment (companion to the diagnosability work in quickbeard/codev-scripts#20):

  • codevhub-spawned installer (node.exe → powershell.exe): killed mid-run by Kaspersky Endpoint Security — no exception, no WER crash record, no Defender log (KES active, Defender passive), deterministic kill point, occasionally the quarantined script vanishing from disk.
  • The identical script from the identical folder (~/.codev-hub/office), launched by the user in an elevated shell: runs to "Verification passed - codev-office skills are ready".

So the trigger is process ancestry, not path or content — and endpoint policy is centrally managed and unchangeable in the affected environments. The affected user base is low-tech, so the fix optimizes for zero typing:

codevhub skill office on Windows no longer spawns the installer. It stages the script + bundle exactly as before, then:

  1. writes Install-CoDev-Office.cmd (Uninstall-CoDev-Office.cmd for the hidden --uninstall flow) next to them, with any --skip-verify/--force-skills flags baked in;
  2. opens the folder in Explorer (best-effort, Windows hosts only);
  3. prints three steps: right-click the .cmd → Run as administrator → approve.

The .cmd reproduces the verified-good ancestry (explorer → cmd → powershell) and ends with pause, so the closing green "Verification passed" — or a [FAIL] from the scripts' new error traps — stays on screen. Ubuntu/macOS keep the fully automatic flow (KES isn't in play there), and --download-only/cross-platform staging also get the wrapper, which is handy for staging onto USB for another machine.

Test plan

  • pnpm typecheck, pnpm check, full download/office suite: 33 passed
  • New tests: windows staging writes the wrapper with flags baked in and never spawns; wrapper name/content cover the uninstall flow (CRLF, %~dp0, pause); the Windows-host test now asserts the handoff instead of the old spawn
  • The explorer-open is crash-safe on spawn failure (async error event handled, not just try/catch)
  • Field: run codevhub skill office on a KES machine → right-click flow → full "Verification passed" (matches the manual procedure already validated in the field today)

🤖 Generated with Claude Code

Quickbeard and others added 2 commits August 5, 2026 17:09
Field diagnosis with a controlled experiment: Kaspersky Endpoint
Security silently kills powershell.exe when it is a child of node.exe
running the office setup script - no exception, no crash record, no
Defender log - while the IDENTICAL script from the IDENTICAL folder
(~/.codev-hub/office) finishes with "Verification passed" when a user
launches it in an elevated shell. The trigger is process ancestry, not
path or content, and endpoint policy is not changeable in the affected
environments.

`codevhub skill office` on Windows therefore no longer spawns the
installer. It stages the script and bundle as before, writes an
Install-CoDev-Office.cmd (Uninstall- for --uninstall) next to them with
any --skip-verify/--force-skills flags baked in, opens the folder in
Explorer, and prints three steps: right-click, Run as administrator,
approve. The .cmd reproduces the verified-good ancestry
(explorer -> cmd -> powershell) and ends with `pause` so the closing
"Verification passed" (or a [FAIL]) stays on screen for low-tech users.
Ubuntu/macOS keep the automatic flow.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…back

Some environments strip "Run as administrator" from the context menu,
and some users have no admin rights at all. The staged .cmd now handles
both from a plain double-click:

- not elevated -> relaunches itself elevated via a UAC prompt
  (Start-Process -Verb RunAs)
- elevation declined or unavailable -> continues non-elevated, which
  the setup script explicitly supports: each component installer raises
  its own permission prompt, and a declined one only skips that
  component (fatal for the .NET SDK alone)

The printed steps now say double-click instead of right-click, with the
no-admin-rights path spelled out.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@quickbeard

Copy link
Copy Markdown
Owner Author

Added a second commit: the staged .cmd is now self-elevating — a plain double-click requests admin rights itself via a UAC prompt (Start-Process -Verb RunAs), covering environments where "Run as administrator" is stripped from the context menu. If elevation is declined or the user has no admin rights, it falls back to a non-elevated run, which the setup script explicitly supports (per-component UAC prompts; a declined one only skips that component, fatal for the .NET SDK alone). Printed instructions updated from right-click to double-click, with the no-admin path spelled out.

@quickbeard
quickbeard merged commit 09ac42a into main Aug 5, 2026
2 of 4 checks passed
@quickbeard
quickbeard deleted the feat/windows-manual-installer-handoff branch August 5, 2026 10:26
quickbeard pushed a commit that referenced this pull request Aug 6, 2026
`codevhub skill office` ships four skills — minimax-docx, minimax-xlsx,
pptx-generator and minimax-pdf — but `codevhub help` and the README both
advertised only DOCX and XLSX, so users had no way to learn that PPTX and
PDF authoring were installed too. `src/lib/office.ts` already documented
all four; only the user-facing copy was stale.

Pin the list with a help test so it can't drift from the bundle again.

Two adjacent README claims in the same section were stale against the
code and are corrected here as well:

- Bundle sizes (610 MB / 820 MB / 1.4 GB) contradicted APPROX_BUNDLE_MB.
  Rather than restate numbers the README has to track, point at the
  heads-up runSkillOffice already prints from that constant.
- The download path and Windows behavior: officeDownloadsDir() returns
  %PUBLIC%\Downloads\codev-office on Windows, and since #244#246
  codevhub deliberately prints the elevated-PowerShell command instead
  of launching the installer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
quickbeard added a commit that referenced this pull request Aug 6, 2026
* docs: name all four office formats in help and README

`codevhub skill office` ships four skills — minimax-docx, minimax-xlsx,
pptx-generator and minimax-pdf — but `codevhub help` and the README both
advertised only DOCX and XLSX, so users had no way to learn that PPTX and
PDF authoring were installed too. `src/lib/office.ts` already documented
all four; only the user-facing copy was stale.

Pin the list with a help test so it can't drift from the bundle again.

Two adjacent README claims in the same section were stale against the
code and are corrected here as well:

- Bundle sizes (610 MB / 820 MB / 1.4 GB) contradicted APPROX_BUNDLE_MB.
  Rather than restate numbers the README has to track, point at the
  heads-up runSkillOffice already prints from that constant.
- The download path and Windows behavior: officeDownloadsDir() returns
  %PUBLIC%\Downloads\codev-office on Windows, and since #244#246
  codevhub deliberately prints the elevated-PowerShell command instead
  of launching the installer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* docs: say what the office skills do, not "authoring"

"Authoring" dates to #233, when the bundle was DOCX-only. It reads as
write-only, and all four skills also read and edit existing files:
minimax-xlsx is "open, create, read, analyze, edit, or validate";
pptx-generator "generate, edit, and read"; minimax-pdf has FILL and
REFORMAT modes alongside CREATE. Name the verbs instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Quickbeard <quickbeard@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant