feat(mcp): add Windows PowerShell installer#444
feat(mcp): add Windows PowerShell installer#444mynameistito wants to merge 4 commits intodmtrKovalenko:mainfrom
Conversation
|
All done with Claude Opus 4.7 and worked as intended for me :) Did not read any of the code, just tested the outcome happy to make itterations should you wish @dmtrKovalenko |
|
I have no idea is this right or not and do not understand anything in powershell but my opus 4.7 told this LMAO I think we should get rid of sha256 check at all |
Addresses review feedback on PR dmtrKovalenko#444: - Force TLS 1.2 on PS 5.1 / older Win10 where SecurityProtocol may default to SSL3/TLS1.0 and GitHub rejects. - Drop sha256 verification entirely. Avoids PS 5.1 vs PS 7 exception-type mismatch (WebException vs HttpResponseException) where ErrorActionPreference=Stop would abort on a missing checksum file instead of warning.
|
that was what my opus thought, maybe good to get other eyes on it but it works as intended for me :) |
|
Both points valid — pushed db25a30:
|
- Add -Version and -InstallDir params (with FFF_MCP_VERSION / FFF_MCP_INSTALL_DIR env-var fallbacks for irm | iex usage). - Detect arch via registry (HKLM\...\Environment) instead of $env:PROCESSOR_ARCHITECTURE — env vars lie under x86/ARM64 emulation. - Skip release-list scan when -Version is pinned. - Prefer curl.exe (ships with Win10 1803+) for downloads, fall back to iwr with $ProgressPreference='SilentlyContinue' to dodge PS 5.1's slow progress bar. - Append install dir to current-session PATH so the user does not need a new shell.
|
Thanks @ccastanedaucf — pushed 47d6006 with all five:
|
| function Add-ToUserPath { | ||
| param([string]$Dir) | ||
| $userPath = [Environment]::GetEnvironmentVariable('Path', 'User') | ||
| if (-not $userPath) { $userPath = '' } | ||
| $entries = $userPath -split ';' | Where-Object { $_ -ne '' } | ||
| if ($entries -notcontains $Dir) { | ||
| $newPath = (@($entries + $Dir) -join ';') | ||
| [Environment]::SetEnvironmentVariable('Path', $newPath, 'User') | ||
| Write-Success "Added $Dir to user PATH." | ||
| } | ||
| # Make available in current session too — no shell restart needed. | ||
| if (-not (Test-OnPath $Dir)) { $env:PATH = "$env:PATH;$Dir" } | ||
| } |
There was a problem hiding this comment.
For what it's worth, some pwsh users such as myself prefer appending to $profile *nix-style rather than modifying the environment variable globally; there could probably be a script param to control this behavior.
There was a problem hiding this comment.
thanks for the feedback pushing another commit out now.
Per @PurpleMyst feedback: some pwsh users prefer appending to $PROFILE *nix-style rather than setting the user environment variable globally. -PathScope User (default) — set HKCU Environment.Path (existing behavior) -PathScope Profile — append `$env:PATH += ';...'` to $PROFILE.CurrentUserAllHosts -PathScope None — skip persistence entirely Env-var fallback: FFF_MCP_PATH_SCOPE (for the irm | iex case). Current-session $env:PATH still updated regardless of scope.
|
Thanks @PurpleMyst — pushed 61fc7e8 with a
Env-var fallback |
|
LGTM |
Summary
Closes #364.
Adds
install-mcp.ps1, a PowerShell mirror ofinstall-mcp.sh, so Windows users can install thefff-mcpbinary with a one-liner. README updated with the Windows command alongside the existing Unix one.The release workflow already publishes
fff-mcp-x86_64-pc-windows-msvc.exeandfff-mcp-aarch64-pc-windows-msvc.exe, so no CI changes needed — the script just consumes existing assets.What it does
PROCESSOR_ARCHITEW6432for WOW64).Invoke-RestMethod)..sha256is missing, same as bash).$env:LOCALAPPDATA\fff-mcp\bin(overridable viaFFF_MCP_INSTALL_DIR).PATHif not already present.claude/opencode/codexand prints the same wiring snippets as the bash script.Invocation
(Eventually you may want to host this on
dmtrkovalenko.dev/install-fff-mcp.ps1for symmetry — README points at the raw GitHub URL for now.)Checklist
FFF_MCP_INSTALL_DIRenv override (parity with bash)[System.Management.Automation.PSParser]::TokenizeTest plan
fff-mcp.exelands in%LOCALAPPDATA%\fff-mcp\bin, confirm it is on PATH in a new shell, confirmfff-mcp --help(or equivalent) runs.$env:FFF_MCP_INSTALL_DIRto a custom dir, confirm install lands there..sha256upstream temporarily (or test against a release missing it) and confirm the script warns instead of failing.