Add ProxiFyre firewall rule management and bump version to 1.1.0
This commit is contained in:
@@ -172,6 +172,17 @@ function Remove-SafeDirectory([string]$Path, [string]$Root) {
|
||||
return $true
|
||||
}
|
||||
|
||||
function Remove-ManagedFirewallRules {
|
||||
$removed = @()
|
||||
foreach ($name in @("ProxyWarden.ProxiFyre.Inbound", "ProxyWarden.ProxiFyre.Outbound")) {
|
||||
$rule = Get-NetFirewallRule -Name $name -ErrorAction SilentlyContinue
|
||||
if ($null -eq $rule) { continue }
|
||||
$rule | Remove-NetFirewallRule -ErrorAction Stop
|
||||
$removed += $name
|
||||
}
|
||||
return $removed
|
||||
}
|
||||
|
||||
function Get-InstalledProgram([string]$Pattern) {
|
||||
$paths = @(
|
||||
"HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*",
|
||||
@@ -220,6 +231,7 @@ try {
|
||||
|
||||
$details.removedProxiFyreServices = Remove-ManagedService -Names @("ProxiFyreService", "ProxiFyre") -InstallRoot $root -UninstallExe (Join-Path $proxifyreDir "ProxiFyre.exe")
|
||||
$details.removedSingBoxServices = Remove-ManagedService -Names @("ProxyWardenSingBox") -InstallRoot $root -UninstallExe (Join-Path $singboxDir "ProxyWardenSingBox.exe")
|
||||
$details.removedProxiFyreFirewallRules = Remove-ManagedFirewallRules
|
||||
$details.removedProxiFyreDir = Remove-SafeDirectory $proxifyreDir $root
|
||||
$details.removedSingBoxDir = Remove-SafeDirectory $singboxDir $root
|
||||
|
||||
|
||||
Reference in New Issue
Block a user