-
Notifications
You must be signed in to change notification settings - Fork 62
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 2 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 |
|---|---|---|
|
|
@@ -18,10 +18,16 @@ TLS. | |
|
|
||
| # Installation | ||
|
|
||
| ## For Linux/MacOS | ||
|
||
| ``` | ||
| cargo install sendme | ||
| ``` | ||
|
|
||
| ## For windows (Run in Powershell) | ||
| ``` | ||
| iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/n0-computer/sendme/main/install-sendme.ps1')) | ||
Anshulgada marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| # Usage | ||
|
|
||
| ## Send side | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| $repo = "n0-computer/sendme" | ||
Anshulgada marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| $release_url = "https://api.github.com/repos/$repo/releases/latest" | ||
|
|
||
| $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 | ||
Uh oh!
There was an error while loading. Please reload this page.