Make install.ps1 work on standard Windows (no admin): junctions + copy, stop deleting the clone#23
Open
plohkoon wants to merge 2 commits into
Open
Make install.ps1 work on standard Windows (no admin): junctions + copy, stop deleting the clone#23plohkoon wants to merge 2 commits into
plohkoon wants to merge 2 commits into
Conversation
The documented Windows flow clones the repo straight into its final location ($HOME\.claude\skills\ghostai) and then runs install.ps1. When the installer links the repo, the repo-link's Source and Target are the same path. New-GhostLink only skipped removal when the target was already a symlink, so against the real cloned directory it fell through to Remove-Item -Recurse -Force and deleted the checkout — then tried to symlink to the now-missing source. install.sh never hit this because it compares the resolved real paths of source and target. Fixes: - Self-path guard: if the target resolves to the same real path as the source, return without touching it (matches install.sh's behavior and preserves the freshly cloned repo). - Symlink-safe removal: delete a reparse point non-recursively. Remove-Item -Recurse on a directory symlink in Windows PowerShell 5.1 follows the link and deletes the target's contents, so re-running install (or update.ps1's re-link) could have wiped the real shared/ directory. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Symbolic links on Windows require admin rights or Developer Mode, so the symlink-based installer failed for ordinary users. Switch to mechanisms that work for a standard user: - Directories (the repo link, shared/, specialists/, agents/) -> directory junctions (New-Item -ItemType Junction). Junctions are reparse points that need no elevation and are transparent to file reads. - SKILL.md -> a copy. Junctions can't target files; a hard link would go stale when git replaces the file on update. update.ps1 re-runs install.ps1, which re-copies SKILL.md, so it stays current. The resulting skill directories are equivalent to the POSIX (symlink) layout: each holds SKILL.md plus shared/ (and specialists/ and agents/ where present), so skill discovery and shared/ resolution work the same. Also drops the up-front symlink-capability gate and the Developer Mode/admin error path (no longer relevant), keeps the self-path guard and the non-recursive reparse-point deletion (which now also cleans up symlinks left by the earlier symlink-based install), and updates the README Windows section and troubleshooting to state no admin/Developer Mode is required. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Makes
install.ps1actually work on a standard Windows account. Two commits:1. Stop deleting the cloned repo
The documented flow clones into the final location and then runs the installer, so the
ghostairepo link's Source and Target are the same path ($HOME\.claude\skills\ghostai).New-GhostLinkonly skipped removal when the target was already a symlink — against the freshly cloned real directory it fell through toRemove-Item -Recurse -Forceand deleted the checkout, then tried to link to the now-missing source.install.shavoids this by comparing resolved real paths; this adds the same self-path guard. Also makes reparse-point removal non-recursive so re-running the installer can't follow a directory link and wipe the real repo (aRemove-Item -Recursefootgun in Windows PowerShell 5.1).2. Use junctions + copy instead of symlinks (no admin / Developer Mode)
This is what the original PR got wrong: symbolic links on Windows require admin rights or Developer Mode, so installs failed for ordinary users on the symlink step. Switched to privilege-free mechanisms:
shared/,specialists/,agents/) → directory junctions (New-Item -ItemType Junction). No elevation, transparent to file reads.SKILL.md→ copy. Junctions can't target a file, and a hard link would go stale whengit pullreplaces the file on update.update.ps1re-runsinstall.ps1, which re-copiesSKILL.md, so it stays current.The resulting skill directories are equivalent to the POSIX symlink layout — each has
SKILL.md+shared/(+specialists//agents/where present) — so skill discovery andshared/resolution behave the same. Dropped the symlink-capability preflight and the Developer-Mode/admin error path; README Windows section + troubleshooting updated to say no admin/Developer Mode is needed (just possibly an execution-policy bypass).Traced flows
update.ps1Caveats
update.ps1, as a non-admin user) is the right gate.git clonebefore installing again.🤖 Generated with Claude Code