feat: stage the Windows office install in %PUBLIC% and bake real-user paths - #245
Merged
Conversation
Two profile-divergence fixes for the Windows flow, prompted by a field report: %USERPROFILE% resolves differently between a normal shell and a UAC elevation approved with a different admin account, so files (and worse, installed skills) landed under the admin's profile where the real user never finds them. - The default staging dir on Windows moves from ~/.codev-hub/office to the profile-independent %PUBLIC%\Downloads\codev-office - the same path for every account, world-writable, not OneDrive-synced. Files already downloaded under the old dot-folder are migrated with same-volume renames so multi-GB bundles are never re-fetched. - The generated .cmd wrappers bake profile-safe paths for the setup and uninstall scripts: -ModulesDir %PUBLIC%\codev-office\node_modules (account-independent) always, and -SkillsRoot pinned to the REAL user's profile when staging on a Windows host (codevhub runs unelevated as that user, so homedir() is authoritative). Cross-platform staging bakes only the modules dir - this host's homedir says nothing about the target machine's user. Wrapper arguments containing spaces are now quoted. Requires the codev-scripts side (-ModulesDir/-SkillsRoot parameters on the Windows scripts) to be published first. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
C:\Users\Public\Downloads is deletable by debloat scripts (harmless - mkdirSync recreates it recursively), but a hardened image can deny non-admin writes under C:\Users\Public entirely. Instead of crashing, staging now falls back to the old per-user ~/.codev-hub/office with a printed notice. --dir overrides keep failing loudly - an explicit choice should not be silently redirected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
Author
|
Added a hardening commit for the "does %PUBLIC%\Downloads exist?" question: the folder is recreated automatically by the recursive mkdir if a debloat script pruned it, and when a hardened image denies non-admin writes under C:\Users\Public entirely, staging now falls back to the old per-user ~/.codev-hub/office with a printed notice instead of crashing (explicit --dir choices still fail loudly). Covered by a chmod-based test. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Companion to quickbeard/codev-scripts#22 — two profile-divergence fixes for the Windows install flow. Field report: when
codevhub skill officeruns in an elevated shell (or the UAC prompt is approved with a different admin account),%USERPROFILE%resolves to the admin's profile and users keep looking for files — and worse, get skills installed — under the wrong account.~/.codev-hub/officeto%PUBLIC%\Downloads\codev-office— the same absolute path for every account (normal shell, elevated shell, any admin), world-writable, not OneDrive-synced, not targeted by Storage Sense. Already-downloaded files migrate from the old dot-folder via same-volume renames, so multi-GB bundles are never re-fetched.--dirstill overrides; Ubuntu/macOS are unchanged..cmdwrappers. The install and uninstall wrappers now pass-ModulesDir %PUBLIC%\codev-office\node_modules(account-independent) and — when staged on a Windows host —-SkillsRootpinned to the real user's skills folder, which codevhub knows authoritatively because it runs unelevated as that user. Combined with codev-scripts#22 (Machine-scopeNODE_PATHwhen elevated), a different-account elevation now installs skills and modules where the actual user needs them. Cross-platform staging bakes only the modules dir, since the staging host's homedir says nothing about the target machine's user. Arguments containing spaces are quoted in the generated.cmd.Deployment order: publish the codev-scripts#22 setup/uninstall scripts before releasing this — the baked
-ModulesDir/-SkillsRootflags are unknown parameters to the older published scripts.Test plan
pnpm typecheck,pnpm check, download/office suite: 36 passed-SkillsRoot.config\codev\skills,node -e "require('pptxgenjs')"works as the real user, staging folder identical from both shells🤖 Generated with Claude Code