diff --git a/README.md b/README.md index 307f934..505cf9c 100644 --- a/README.md +++ b/README.md @@ -18,10 +18,21 @@ TLS. # Installation +## Build from Source ``` cargo install sendme ``` +## For Linux/MacOS/Windows (bash) +``` +curl -fsSL https://iroh.computer/sendme.sh | sh +``` + +## For Windows (Run in Powershell) +``` +iwr https://iroh.computer/sendme.ps1 -useb | iex +``` + # Usage ## Send side diff --git a/install-sendme.ps1 b/install-sendme.ps1 new file mode 100644 index 0000000..b40d09c --- /dev/null +++ b/install-sendme.ps1 @@ -0,0 +1,34 @@ +$release_url = "https://api.github.com/repos/n0-computer/sendme/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