-
Notifications
You must be signed in to change notification settings - Fork 109
Add Windows fda install script, update docs #5856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Feldera fda CLI installer for Windows | ||
| # Usage: | ||
| # irm https://feldera.com/install-fda.ps1 | iex | ||
| # $env:FDA_VERSION="v0.270.0"; irm https://feldera.com/install-fda.ps1 | iex | ||
| # $env:FELDERA_INSTALL="C:\tools\feldera"; irm https://feldera.com/install-fda.ps1 | iex | ||
|
|
||
| $ErrorActionPreference = 'Stop' | ||
|
|
||
| $FelderaInstall = if ($env:FELDERA_INSTALL) { $env:FELDERA_INSTALL } else { "$env:USERPROFILE\.feldera" } | ||
| $BinDir = "$FelderaInstall\bin" | ||
|
|
||
| # AddressWidth is OS bitness, not CPU arch: blocks 32-bit Windows only. | ||
| # arm64 passes and gets the x86_64 binary, which runs via Windows emulation. | ||
| $Arch = (Get-CimInstance Win32_Processor).AddressWidth | ||
| if ($Arch -ne 64) { | ||
| Write-Error "Unsupported OS: only 64-bit Windows is supported." | ||
| exit 1 | ||
| } | ||
| $Target = "x86_64-pc-windows-msvc" | ||
|
|
||
| if ($env:FDA_VERSION) { | ||
| $Version = $env:FDA_VERSION | ||
| $DownloadUrl = "https://github.com/feldera/feldera/releases/download/$Version/fda-$Target.zip" | ||
| Write-Host "Installing fda $Version" | ||
| } else { | ||
| $DownloadUrl = "https://github.com/feldera/feldera/releases/latest/download/fda-$Target.zip" | ||
| Write-Host "Installing fda (latest)" | ||
| } | ||
|
|
||
| $TmpDir = [System.IO.Path]::GetTempPath() + [System.Guid]::NewGuid().ToString() | ||
| New-Item -ItemType Directory -Path $TmpDir | Out-Null | ||
|
|
||
| try { | ||
| $TmpZip = "$TmpDir\fda.zip" | ||
|
|
||
| Write-Host "Downloading from $DownloadUrl" | ||
| Invoke-WebRequest -Uri $DownloadUrl -OutFile $TmpZip -UseBasicParsing | ||
|
|
||
| Write-Host "Extracting fda binary" | ||
| Expand-Archive -Path $TmpZip -DestinationPath $TmpDir -Force | ||
|
|
||
| New-Item -ItemType Directory -Force -Path $BinDir | Out-Null | ||
| Move-Item -Force "$TmpDir\fda.exe" "$BinDir\fda.exe" | ||
|
|
||
| Write-Host "Installed fda to $BinDir\fda.exe" | ||
| } finally { | ||
| Remove-Item -Recurse -Force $TmpDir -ErrorAction SilentlyContinue | ||
| } | ||
|
|
||
| # Add to PATH (user scope) if not already present | ||
| $UserPath = [Environment]::GetEnvironmentVariable('PATH', 'User') | ||
| if ($UserPath -notlike "*$BinDir*") { | ||
| [Environment]::SetEnvironmentVariable('PATH', "$BinDir;$UserPath", 'User') | ||
| Write-Host "Added $BinDir to PATH (user). Restart your shell for it to take effect." | ||
| } | ||
|
|
||
| Write-Host "" | ||
| Write-Host "fda was installed successfully!" | ||
| & "$BinDir\fda.exe" --version 2>$null | ||
|
|
||
| Write-Host "" | ||
| Write-Host "To enable shell completions, see:" | ||
| Write-Host " https://docs.feldera.com/docs/interface/cli#optional-shell-completion" | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
AddressWidthreturns 32 or 64 based on OS bitness, not CPU architecture. It correctly blocks 32-bit Windows, but arm64 Windows will also pass this check (both report 64). Since only x86_64-pc-windows-msvc is shipped right now that is fine — just worth a comment:# Note: detects 32-bit OS; arm64 will pass.