-
Notifications
You must be signed in to change notification settings - Fork 54
Add PowerShell script for Windows installation #73
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
ccdd053
8c259de
7583326
c196432
3ba5e53
cf6d5fe
508d104
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
$release_url = "https://api.github.com/repos/n0-computer/sendme/releases/latest" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And can we drop this as the script now lives in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would change the release_url to |
||
|
||
$target = "windows-x86_64" | ||
$zipFile = "sendme.zip" | ||
$extractPath = ".\sendme" | ||
|
||
Write-Host "Fetching latest release for $target..." | ||
$releaseJson = Invoke-RestMethod -Uri $release_url | ||
$releaseUrl = ($releaseJson.assets | Where-Object { $_.browser_download_url -match $target }).browser_download_url | ||
|
||
if (-not $releaseUrl) { | ||
Write-Host "Error: No release found for $target" -ForegroundColor Red | ||
exit 1 | ||
} | ||
|
||
Write-Host "Downloading from $releaseUrl..." | ||
Invoke-WebRequest -Uri $releaseUrl -OutFile $zipFile | ||
|
||
Write-Host "Extracting..." | ||
Expand-Archive -Path $zipFile -DestinationPath $extractPath -Force | ||
|
||
Write-Host "Cleaning up..." | ||
Remove-Item -Force $zipFile | ||
|
||
Write-Host "Installation complete!" | ||
|
||
# Add the 'sendme' folder to PATH | ||
$sendmePath = (Resolve-Path $extractPath).Path | ||
|
||
# Add the folder to the PATH permanently (user level) | ||
$env:Path += ";$sendmePath" | ||
[System.Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::User) | ||
|
||
Write-Host "'$sendmePath' has been permanently added to user PATH." -ForegroundColor Green |
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.
Can we update this to be
## For Linux/MacOS/Windows (bash)
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.
The README has been updated, but the issue for the powershell cmd persists as noted in [#320](n0-computer/iroh.computer#320). Any recommendations on how to resolve this?