1
0
mirror of https://github.com/r4sas/chocolatey-packages synced 2025-01-21 04:10:05 +00:00
chocolatey-packages/yggdrasil/tools/chocolateyuninstall.ps1
R4SAS 0b577d8ce5
add yggdrasil package
Signed-off-by: R4SAS <r4sas@i2pmail.org>
2019-11-22 04:08:30 +03:00

24 lines
857 B
PowerShell

$ErrorActionPreference = 'Stop'; # stop on all errors
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$appDir = "$([Environment]::GetFolderPath('ProgramFiles'))\Yggdrasil"
$startMenuDir = "$([Environment]::GetFolderPath('CommonStartMenu'))\Programs\Yggdrasil"
# Remove shims
Uninstall-BinFile "yggdrasil"
Uninstall-BinFile "yggdrasilctl"
# Remove shortcuts from Start Menu
Remove-Item $startMenuDir -Recurse
# Stop and remove service if it was installed
if (Get-WmiObject -Class Win32_Service -Filter "Name='Yggdrasil'") {
& sc stop "Yggdrasil"
& sc delete "Yggdrasil"
}
# Remove binaries, but don't touch configs
Write-Host "We removing binaries, but doesn't touch your configs. You can still find them in '$appDir' directory"
Remove-Item "$appDir\yggdrasil.exe"
Remove-Item "$appDir\yggdrasilctl.exe"