-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.ps1
More file actions
53 lines (44 loc) · 2.55 KB
/
Copy pathuninstall.ps1
File metadata and controls
53 lines (44 loc) · 2.55 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
# ==============================================================================
# DevMemory AI v1.1.0 — Automated PowerShell Uninstaller (Windows)
# ==============================================================================
$ErrorActionPreference = "SilentlyContinue"
Write-Host ""
Write-Host "========================================================" -ForegroundColor Cyan
Write-Host " DevMemory AI v1.1.0 Uninstallation " -ForegroundColor Cyan
Write-Host "========================================================" -ForegroundColor Cyan
Write-Host ""
# 1. Safely disable all active projects & unregister background services
if (Get-Command dmai -ErrorAction SilentlyContinue) {
Write-Host "[INFO] Stopping background watcher daemons & unregistering OS services..." -ForegroundColor Yellow
try { dmai disable --all } catch {}
}
# 2. Clean up Windows scheduled tasks & startup scripts
try { schtasks /Delete /TN "DevMemoryWatcher_*" /F 2>$null } catch {}
$StartupDir = "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup"
if (Test-Path $StartupDir) {
Get-ChildItem -Path $StartupDir -Filter "devmemory-*.vbs" -ErrorAction SilentlyContinue | Remove-Item -Force -ErrorAction SilentlyContinue
}
# 3. Kill remaining background watcher daemon processes
try {
Get-Process | Where-Object { $_.CommandLine -like "*watcher*" -or $_.CommandLine -like "*daemon*" } | Stop-Process -Force -ErrorAction SilentlyContinue
} catch {}
# 4. Remove CLI executable symlinks
$BunBinDir = "$env:USERPROFILE\.bun\bin"
if (Test-Path "$BunBinDir\dmai.cmd") { Remove-Item "$BunBinDir\dmai.cmd" -Force -ErrorAction SilentlyContinue }
if (Test-Path "$BunBinDir\dmai") { Remove-Item "$BunBinDir\dmai" -Force -ErrorAction SilentlyContinue }
# 5. Remove system directories
$InstallDir = "$env:USERPROFILE\.devmemory-ai"
if (Test-Path $InstallDir) {
Write-Host "[INFO] Removing DevMemory AI repository ($InstallDir)..." -ForegroundColor Yellow
Remove-Item -Path $InstallDir -Recurse -Force -ErrorAction SilentlyContinue
}
$GlobalDir = "$env:USERPROFILE\.devmemory"
if (Test-Path $GlobalDir) {
Write-Host "[INFO] Removing global configuration ($GlobalDir)..." -ForegroundColor Yellow
Remove-Item -Path $GlobalDir -Recurse -Force -ErrorAction SilentlyContinue
}
Write-Host ""
Write-Host "========================================================" -ForegroundColor Green
Write-Host " DevMemory AI Successfully Uninstalled! " -ForegroundColor Green
Write-Host "========================================================" -ForegroundColor Green
Write-Host ""