Files
vpn-proxy/scripts/uninstall-all.ps1

59 lines
2.2 KiB
PowerShell
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ==========================================
# 🗑️ UNINSTALL ALL (CLEANUP)
# ==========================================
param([switch]$Debug)
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
. "$ScriptDir\lib\Common.ps1"
. "$ScriptDir\lib\System.ps1"
if ($Debug) { Set-DebugMode -Enabled $true }
Write-Header "ПОЛНОЕ УДАЛЕНИЕ" -ClearScreen
Ensure-Admin
Write-Warning "Это действие удалит весь установленный софт:"
Write-Host " - Sing-box (Служба и файлы)" -ForegroundColor Gray
Write-Host " - ProxiFyre (Служба и файлы)" -ForegroundColor Gray
Write-Host " - Драйвер WinPacketFilter" -ForegroundColor Gray
Write-Host ""
if ((Read-Host "Вы уверены? (y/n)") -ne 'y') { exit }
Write-Step "Удаление Sing-box..."
Manage-ScheduledTask -Name "SingBoxProxy" -Action "Stop"
Manage-ScheduledTask -Name "SingBoxProxy" -Action "Uninstall"
if (Test-Path "C:\Tools\sing-box") {
Remove-Item "C:\Tools\sing-box" -Recurse -Force -ErrorAction SilentlyContinue
Write-Success "Файлы удалены"
}
Write-Step "Удаление Discord Proxy (ProxiFyre)..."
$pfDir = "C:\Tools\ProxiFyre"
if (Test-Path "$pfDir\ProxiFyre.exe") {
if (Get-DebugMode) {
& "$pfDir\ProxiFyre.exe" uninstall
}
else {
& "$pfDir\ProxiFyre.exe" uninstall 2>&1 | Out-Null
}
Start-Sleep -Seconds 2
Write-Success "Служба удалена"
}
if (Test-Path $pfDir) {
Remove-Item $pfDir -Recurse -Force -ErrorAction SilentlyContinue
Write-Success "Файлы удалены"
}
Write-Step "Удаление драйвера..."
# Тут сложно удалить MSI тихо без GUID, но попробуем через known path или пропустим, т.к. драйвер может быть нужен другим
Write-Info "Драйвер WinPacketFilter оставлен (он может использоваться другим ПО)."
Write-Info "Если нужно, удалите его через 'Установка и удаление программ'."
Write-Success "Очистка завершена!"
Start-Sleep -Seconds 3