File: uninstall.ps1

package info (click to toggle)
browserpass 2.0.22-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 568 kB
  • sloc: sh: 128; makefile: 112
file content (31 lines) | stat: -rw-r--r-- 1,312 bytes parent folder | download
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
}