Skip to content

Instantly share code, notes, and snippets.

@delthas
Created October 16, 2017 22:41
Show Gist options
  • Save delthas/723590c42ee69004ed458dcbd0aa079d to your computer and use it in GitHub Desktop.
Save delthas/723590c42ee69004ed458dcbd0aa079d to your computer and use it in GitHub Desktop.
Exact Audio Copy uninstall automation script
$ErrorActionPreference = 'Stop'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$ahkScript = "$toolsDir\eacuninstall.ahk"
[array]$key = Get-UninstallRegistryKey -SoftwareName 'Exact Audio Copy*'
if ($key.Count -eq 1) {
$key | % {
AutoHotkey $ahkScript "$($_.UninstallString)"
}
} elseif ($key.Count -eq 0) {
Write-Warning "$packageName has already been uninstalled by other means."
} elseif ($key.Count -gt 1) {
Write-Warning "$($key.Count) matches found!"
Write-Warning "To prevent accidental data loss, no programs will be uninstalled."
Write-Warning "Please alert package maintainer the following keys were matched:"
$key | % {Write-Warning "- $($_.DisplayName)"}
}
#NoEnv
SetTitleMatchMode RegEx
IfExist, %1%
{
Run, %1%
WinWait,Exact Audio Copy [\d\.]+ Uninstall,, 30
IfWinExist
{
BlockInput, On
Sleep, 250
WinActivate
SendInput, {Left}, {Enter}
BlockInput, Off
}
WinWait, Exact Audio Copy [\d\.]+ Uninstall, successfully, 30
IfWinExist
{
BlockInput, On
Sleep, 250
WinActivate
SendInput, {Enter}
BlockInput, Off
}
exit
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment