# Iterum uninstaller # Usage (PowerShell): irm https://iterum.nhaajt.com/uninstall.ps1 | iex # # Removes the app folder and its two shortcuts. # Your training data (%APPDATA%\Iterum) is only deleted if you answer y. & { # ---- where things are ---------------------------------------------------- $InstallDir = Join-Path $env:LOCALAPPDATA 'Iterum' $DataDir = Join-Path $env:APPDATA 'Iterum' $StartMenuDir = Join-Path $env:APPDATA 'Microsoft\Windows\Start Menu\Programs' $DesktopDir = [Environment]::GetFolderPath('Desktop') # -------------------------------------------------------------------------- $ErrorActionPreference = 'Stop' function Say($msg) { Write-Host " $msg" } function Ok($msg) { Write-Host " $msg" -ForegroundColor Green } Write-Host '' Write-Host ' ITERUM uninstall' -ForegroundColor Red Write-Host '' while (@(Get-Process -Name 'Iterum' -ErrorAction SilentlyContinue).Count -gt 0) { Write-Host ' Iterum is running. Close it, then press Enter (or type q to cancel).' -ForegroundColor Yellow $answer = Read-Host ' ' if ($null -eq $answer -or $answer -match '^\s*q') { Write-Host ' Cancelled. Nothing was removed.' -ForegroundColor Red return } } if (Test-Path $InstallDir) { cmd /c "rd /s /q `"\\?\$InstallDir`"" | Out-Null Ok "Removed $InstallDir" } else { Say "Not installed at $InstallDir" } foreach ($dir in @($StartMenuDir, $DesktopDir)) { if (-not $dir) { continue } $lnk = Join-Path $dir 'Iterum.lnk' if (Test-Path $lnk) { Remove-Item -Path $lnk -Force Ok "Removed $lnk" } } if (Test-Path $DataDir) { Write-Host '' Say "Your training history and settings are in $DataDir" $answer = Read-Host ' Delete them too? [y/N]' if ($answer -match '^\s*y') { Remove-Item -Path $DataDir -Recurse -Force Ok "Removed $DataDir" } else { Say 'Kept. Reinstall any time and they will still be there.' } } Write-Host '' Ok 'Iterum is uninstalled.' Write-Host '' }