forked from browserpass/browserpass-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.ps1
31 lines (26 loc) · 1.28 KB
/
uninstall.ps1
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
$app = 'com.dannyvankooten.browserpass'
$dirpath = Join-Path -Path $env:localappdata -ChildPath 'browserpass'
if (Test-Path -Path $dirPath) {
Remove-Item -Recurse -Force $dirpath
}
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
[Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Warning "Please re-run this script with Admin rights!"
exit
}
If (Test-Path -Path "hklm:\Software\Google\Chrome\NativeMessagingHosts\$app") {
Write-Host "Uninstalling for Chrome - all users"
Remove-Item -Path "hklm:\Software\Google\Chrome\NativeMessagingHosts\$app" -force
}
if (Test-Path -Path "hklm:\Software\Mozilla\NativeMessagingHosts\$app") {
Write-Host "Uninstalling for Firefox - all users"
Remove-Item -Path "hklm:\Software\Mozilla\NativeMessagingHosts\$app" -force
}
if (Test-Path -Path "hkcu:\Software\Mozilla\NativeMessagingHosts\$app") {
Write-Host "Uninstalling for Firefox - local user"
Remove-Item -Path "hkcu:\Software\Mozilla\NativeMessagingHosts\$app" -force
}
if (Test-Path -Path "hkcu:\Software\Google\Chrome\NativeMessagingHosts\$app") {
Write-Host "Uninstalling for Chrome - local user"
Remove-Item -Path "hkcu:\Software\Google\Chrome\NativeMessagingHosts\$app" -force
}