diff --git a/unified_sheepit_launcher.ps1 b/unified_sheepit_launcher.ps1 index 990aed2..f6e8bdf 100644 --- a/unified_sheepit_launcher.ps1 +++ b/unified_sheepit_launcher.ps1 @@ -57,28 +57,23 @@ try { `$urls = $urlLiteral `$headers = @{ 'User-Agent' = 'Mozilla/5.0' } - if (Test-Path `$jarPath) { - Write-Host "SheepIt client already present at `$jarPath. Skipping download." -ForegroundColor Green + # Always fetch client-latest; cached jars go stale when the farm bumps minimum client version. + `$downloaded = `$false + foreach (`$url in `$urls) { + Write-Host "Downloading SheepIt client from `$url..." -ForegroundColor Cyan + try { + Invoke-WebRequest -Uri `$url -OutFile `$jarPath -UseBasicParsing -Headers `$headers + `$downloaded = `$true + Write-Host "Download complete -> `$jarPath" -ForegroundColor Green + break + } + catch { + Write-Host ("Download failed from {0}: {1}" -f `$url, `$_.Exception.Message) -ForegroundColor Yellow + } } - else { - `$downloaded = `$false - foreach (`$url in `$urls) { - Write-Host "Downloading SheepIt client from `$url..." -ForegroundColor Cyan - try { - Invoke-WebRequest -Uri `$url -OutFile `$jarPath -UseBasicParsing -Headers `$headers - `$downloaded = `$true - Write-Host "Download complete." -ForegroundColor Green - break - } - catch { - Write-Host ("Download failed from {0}: {1}" -f `$url, `$_.Exception.Message) -ForegroundColor Yellow - } - } - - if (-not `$downloaded) { - throw 'Unable to download SheepIt client from any known URL.' - } + if (-not `$downloaded) { + throw 'Unable to download SheepIt client from any known URL.' } Write-Host "Starting SheepIt client..." -ForegroundColor Cyan