-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathUninstaller.ps1
40 lines (34 loc) · 1.18 KB
/
Uninstaller.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
32
33
34
35
36
37
38
39
40
$bins = @()
$ErrorActionPreference = "Stop"
Write-Host "Finding Alteryx Admin Install Location..."
$reg = Get-ItemProperty HKLM:\SOFTWARE\WOW6432Node\SRC\Alteryx -ErrorAction SilentlyContinue
if ($reg -ne $null -and $reg.InstallDir64 -ne $null) {
$bins += $reg.InstallDir64
}
Write-Host "Finding Alteryx User Install Location..."
$reg = Get-ItemProperty HKCU:\SOFTWARE\SRC\Alteryx -ErrorAction SilentlyContinue
if ($reg -ne $null -and $reg.InstallDir64 -ne $null) {
$bins += $reg.InstallDir64
}
if ($bins.Count -eq 0) {
Write-Host "Failed to find Alteryx Install"
exit -1
}
$files = @()
$files += "RuntimeData\FormulaAddIn\Random.xml"
$files += "RuntimeData\FormulaAddIn\MathUtils.xml"
$files += "RuntimeData\FormulaAddIn\MiscUtils.xml"
$files += "RuntimeData\FormulaAddIn\StringUtils.xml"
$files += "RuntimeData\FormulaAddIn\DateUtils.xml"
$files += "RuntimeData\FormulaAddIn\JDFormulaAddIn.dll"
$files += "RuntimeData\FormulaAddIn\AlteryxAbacus.dll"
foreach ($bin in $bins) {
Write-Host "Uninstalling from $bin ..."
foreach ($file in $files) {
$target = Join-Path $bin $file
if (Test-Path $target) {
Remove-Item $target
}
}
}
exit 0