-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUninstall.ps1
More file actions
45 lines (38 loc) · 1.6 KB
/
Uninstall.ps1
File metadata and controls
45 lines (38 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Uninstall.ps1
# Removes the Brio Anti-AutoFocus solution.
# 1. Unregisters the Scheduled Task.
# 2. Removes the installation directory and logs.
# Run this script as Administrator.
$ErrorActionPreference = "Stop"
# Check for Administrator privileges
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Warning "This script requires Administrator privileges. Please run as Administrator."
exit
}
$taskName = "BrioManualFocus"
$installDir = "C:\ProgramData\BrioAntiAutoFocus"
Write-Host "--- Uninstalling Brio Anti-AutoFocus ---"
# 1. Remove Scheduled Task
Write-Host "Removing Scheduled Task '$taskName'..."
try {
Unregister-ScheduledTask -TaskName $taskName -Confirm:$false -ErrorAction Stop
Write-Host " Task removed successfully."
} catch {
Write-Warning " Task not found or could not be removed: $_"
}
# 2. Remove Installation Directory
if (Test-Path $installDir) {
Write-Host "Removing installation directory '$installDir'..."
try {
Remove-Item -Path $installDir -Recurse -Force -ErrorAction Stop
Write-Host " Directory removed successfully."
} catch {
Write-Warning " Could not remove directory: $_"
}
} else {
Write-Host " Installation directory not found."
}
Write-Host "----------------------------------------"
Write-Host "Uninstallation Complete."
Write-Host "Note: Registry settings applied to the camera driver have not been reverted."
Write-Host "You can use Logitech G Hub or LogiTune to re-enable Autofocus if desired."