From 9fd7fb2c37f15a89d2ba39224e47122aa8d2690e Mon Sep 17 00:00:00 2001 From: Baipyrus <39416358+Baipyrus@users.noreply.github.com> Date: Sun, 22 Sep 2024 15:03:15 +0200 Subject: [PATCH] download most recent release instead of latest --- install.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/install.ps1 b/install.ps1 index 24beade..34b9c15 100644 --- a/install.ps1 +++ b/install.ps1 @@ -45,8 +45,11 @@ if ($isRelease) # Download release files from github as-is Write-Host "Downloading program into local directory..." -ForegroundColor Cyan - Invoke-RestMethod "https://github.com/Baipyrus/ProxySwitcher/releases/latest/download/ProxySwitcher.zip" -OutFile $tmpPRSWzip - + $releases = Invoke-RestMethod "https://api.github.com/repos/Baipyrus/ProxySwitcher/releases" + $assets = $releases[0].assets + $archive = $assets | Where-Object name -match "zip" + Invoke-RestMethod $archive.browser_download_url -OutFile $tmpPRSWzip + # Expand Archive to program directory Expand-Archive $tmpPRSWzip -DestinationPath $programPath -Force }