From 29fe64ed422e364ec5f27edd87c8b9d1fc7cf60e Mon Sep 17 00:00:00 2001 From: contrary Date: Sat, 24 Oct 2026 19:15:04 +0000 Subject: [PATCH] Update install.ps1 --- install.ps1 | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/install.ps1 b/install.ps1 index fd602a3..fea78da 100644 --- a/install.ps1 +++ b/install.ps1 @@ -1,4 +1,4 @@ -# SteamDaddy One-Click Installer — github.com/Contrary7/SteamDaddy-Backup +# SteamDaddy One-Click Installer — contrary7.duckdns.org/contrary/steamdaddy # Safe community patcher for Steam games. Not malware. $ErrorActionPreference = "Stop" @@ -16,10 +16,23 @@ if (-not $isAdmin) { # Running from pipe (irm|iex) — save to temp file first, then re-launch with -File # This avoids spawning a child process whose command line contains "irm ... | iex" $tmpScript = Join-Path $env:TEMP "SteamDaddy_Install.ps1" - (New-Object System.Net.WebClient).DownloadFile( + $scriptUrls = @( + "https://contrary7.duckdns.org/contrary/steamdaddy/raw/branch/main/install.ps1", "https://raw.githubusercontent.com/Contrary7/SteamDaddy-Backup/main/install_b.ps1", - $tmpScript + "https://codeberg.org/Contrary/SteamDaddy/raw/branch/main/install.ps1" ) + $elevateSaved = $false + foreach ($sUrl in $scriptUrls) { + try { + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + (New-Object System.Net.WebClient).DownloadFile($sUrl, $tmpScript) + if ((Test-Path $tmpScript) -and (Get-Item $tmpScript).Length -gt 500) { + $elevateSaved = $true + break + } + } catch {} + } + if (-not $elevateSaved) { throw "Could not fetch elevation script from DuckDNS or fallbacks." } Start-Process powershell.exe -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$tmpScript`"" -Verb RunAs -ErrorAction Stop exit } @@ -31,7 +44,11 @@ if (-not $isAdmin) { Write-Host "[SteamDaddy] Fetching latest release..." -ForegroundColor Cyan try { - $downloadUrl = "https://github.com/Contrary7/SteamDaddy-Backup/releases/latest/download/SteamDaddy.exe" + $candidateUrls = @( + "https://contrary7.duckdns.org/contrary/steamdaddy/releases/download/latest/SteamDaddy.exe", + "https://github.com/Contrary7/SteamDaddy-Backup/releases/latest/download/SteamDaddy.exe", + "https://codeberg.org/Contrary/SteamDaddy/releases/download/latest/SteamDaddy.exe" + ) $desktop = [Environment]::GetFolderPath("Desktop") $destPath = Join-Path $desktop "SteamDaddy.exe" @@ -214,7 +231,24 @@ try { } Write-Host "[SteamDaddy] Downloading SteamDaddy.exe to Desktop..." -ForegroundColor Magenta - Invoke-WebRequest -Uri $downloadUrl -OutFile $destPath -UseBasicParsing + $downloadSuccess = $false + foreach ($cUrl in $candidateUrls) { + try { + Write-Host "[SteamDaddy] Attempting download from: $cUrl" -ForegroundColor Cyan + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + Invoke-WebRequest -Uri $cUrl -OutFile $destPath -UseBasicParsing -TimeoutSec 20 + if ((Test-Path $destPath) -and (Get-Item $destPath).Length -gt 1000000) { + $downloadSuccess = $true + Write-Host "[SteamDaddy] Download completed successfully!" -ForegroundColor Green + break + } + } catch { + Write-Host "[SteamDaddy] Mirror failed, trying next fallback..." -ForegroundColor DarkYellow + } + } + if (-not $downloadSuccess) { + throw "Failed to download SteamDaddy.exe from all mirrors." + } Write-Host "[SteamDaddy] Launching SteamDaddy..." -ForegroundColor Green Start-Process $destPath