diff --git a/uninstall.ps1 b/uninstall.ps1 new file mode 100644 index 0000000..f6d7911 --- /dev/null +++ b/uninstall.ps1 @@ -0,0 +1,52 @@ +#Requires -RunAsAdministrator + +# Остановка служб +Stop-Service -Name "vncserver", "RServer3" -Force -ErrorAction SilentlyContinue + +# Удаление VNC Server (MSI) +$vnc = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -like "*VNC Server*" } +if ($vnc) { $vnc.Uninstall() | Out-Null; Write-Host "VNC Server удалён" } + +Write-Host "Принудительное удаление Radmin Server..." -ForegroundColor Yellow + +# Останавливаем службу и процессы +Stop-Service -Name "RServer3" -Force -ErrorAction SilentlyContinue +Get-Process -Name "*rserver*", "*radmin*" -ErrorAction SilentlyContinue | Stop-Process -Force +Start-Sleep -Seconds 2 + +# Удаляем службу +sc.exe delete "RServer3" + +# Удаляем файлы +$radminPaths = @( + "C:\WINDOWS\SysWOW64\rserver30", + "C:\Program Files (x86)\Radmin Server 3", + "C:\Program Files\Radmin Server 3" +) + +foreach ($path in $radminPaths) { + if (Test-Path $path) { + Remove-Item -Path $path -Recurse -Force -ErrorAction SilentlyContinue + Write-Host "Удалено: $path" -ForegroundColor Green + } +} + +# Удаляем записи реестра +$regPaths = @( + "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{1B704FD1-C00F-482F-8997-82F2F19E10E7}", + "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1B704FD1-C00F-482F-8997-82F2F19E10E7}", + "HKLM:\SOFTWARE\WOW6432Node\Famatech", + "HKLM:\SOFTWARE\Famatech" +) + +foreach ($reg in $regPaths) { + if (Test-Path $reg) { + Remove-Item -Path $reg -Recurse -Force -ErrorAction SilentlyContinue + Write-Host "Удалён ключ: $reg" -ForegroundColor Green + } +} + +# Удаляем из списка MSI продуктов +Remove-Item -Path "HKCR:\Installer\Products\*" -Recurse -Force -ErrorAction SilentlyContinue 2>$null + +Write-Host "`nRadmin Server удалён принудительно" -ForegroundColor Green \ No newline at end of file