diff --git a/full_install.ps1 b/full_install.ps1 index 86c26be..ff7de55 100644 --- a/full_install.ps1 +++ b/full_install.ps1 @@ -74,6 +74,9 @@ New-Item -ItemType Directory -Path $localDir | Out-Null $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path if (-not $scriptDir) { $scriptDir = Get-Location } +# Ensure TLS 1.2 for GitHub downloads +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + $filesToGet = @("ssh_manager.py", "gen_icon.py") foreach ($f in $filesToGet) { $localFile = Join-Path $scriptDir $f @@ -84,10 +87,20 @@ foreach ($f in $filesToGet) { } else { Write-Host "[*] Downloading $f from GitHub..." -ForegroundColor Yellow try { - Invoke-WebRequest -Uri "$REPO_RAW/$f" -OutFile $destFile -UseBasicParsing - Write-Host "[OK] $f (downloaded)" -ForegroundColor Green + $url = "$REPO_RAW/$f" + Write-Host " URL: $url" -ForegroundColor DarkGray + $wc = New-Object System.Net.WebClient + $wc.Headers.Add("User-Agent", "PCA-SSH-Installer") + $wc.DownloadFile($url, $destFile) + if (Test-Path $destFile) { + $sz = (Get-Item $destFile).Length + Write-Host "[OK] $f ($sz bytes)" -ForegroundColor Green + } else { + throw "File not saved" + } } catch { - Write-Host "[FAIL] Cannot download $f" -ForegroundColor Red + Write-Host "[FAIL] Cannot download $f : $_" -ForegroundColor Red + Write-Host "Try manual download: https://github.com/andrey271192/ssh-manage" -ForegroundColor Yellow Read-Host "Press Enter" exit 1 } diff --git a/install_windows.txt b/install_windows.txt index 784ce67..883f6e5 100644 --- a/install_windows.txt +++ b/install_windows.txt @@ -5,7 +5,7 @@ СПОСОБ 1 — Одна команда (рекомендуется) Скопируй и вставь в PowerShell: -irm https://raw.githubusercontent.com/andrey271192/ssh-manage/main/full_install.ps1 -OutFile $env:TEMP\pca_install.ps1; powershell -ExecutionPolicy Bypass -File $env:TEMP\pca_install.ps1 +[Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::Tls12; $wc=New-Object Net.WebClient; $wc.Headers.Add('User-Agent','PCA'); $wc.DownloadFile('https://raw.githubusercontent.com/andrey271192/ssh-manage/main/full_install.ps1',"$env:TEMP\pca_install.ps1"); powershell -ExecutionPolicy Bypass -File $env:TEMP\pca_install.ps1 Что произойдёт: - Скачает установщик с GitHub