38 lines
1.0 KiB
PowerShell
38 lines
1.0 KiB
PowerShell
# VoidLibC Windows uninstaller. Reverses install.ps1.
|
|
|
|
param(
|
|
[string]$InstallDir = "$env:LOCALAPPDATA\VoidLibC\bin"
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
foreach ($exe in @("voidlink.exe", "voidloader.exe")) {
|
|
$f = Join-Path $InstallDir $exe
|
|
if (Test-Path $f) {
|
|
Write-Host "Removing $f"
|
|
Remove-Item -Force $f
|
|
} else {
|
|
Write-Host "(not found: $f — skipping)"
|
|
}
|
|
}
|
|
|
|
# Remove .vle file association.
|
|
foreach ($key in @("HKCU:\Software\Classes\.vle",
|
|
"HKCU:\Software\Classes\VoidLibC.VLE.1")) {
|
|
if (Test-Path $key) {
|
|
Write-Host "Removing registry key $key"
|
|
Remove-Item -Recurse -Force $key
|
|
}
|
|
}
|
|
|
|
# Remove from user PATH.
|
|
$userPath = [Environment]::GetEnvironmentVariable("PATH", "User") ?? ""
|
|
$newPath = ($userPath -split ";" | Where-Object { $_ -ne $InstallDir }) -join ";"
|
|
if ($newPath -ne $userPath) {
|
|
[Environment]::SetEnvironmentVariable("PATH", $newPath, "User")
|
|
Write-Host "Removed $InstallDir from user PATH."
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "VoidLibC uninstalled."
|