Text to vertical video in 100+ styles: AI codes each scene (HTML/SVG/WebGL), renders a 9:16 MP4 with music and English/Vietnamese voice. MCP, CLI and REST for AI agents.
# Gỡ LumReels khỏi Windows.
# powershell -ExecutionPolicy Bypass -File install\windows\uninstall.ps1 [-Purge] [-Yes] [-DryRun]
# Xoá: %LOCALAPPDATA%\LumReels (mã app, launcher, log) + shortcut Desktop/Start Menu; tắt server LumReels đang chạy từ đó.
# GIỮ LẠI (trừ khi -Purge): ~/.lumreels (khoá AI đã nhập, giọng của tôi, gói mẫu, nháp)
# và video đã dựng: jobs/, edits/ trong thư mục app được chuyển sang ~/.lumreels/backup-<ngày giờ>/ trước khi xoá.
# -Purge: xoá luôn ~/.lumreels và không giữ video đã dựng. Chỉ xoá khi đường dẫn đúng dạng thư mục LumReels
# (tên chứa "lumreels", không phải gốc ổ / thư mục người dùng / hệ thống); LUMREELS_HOME đặt chỗ khác thì từ chối, tự xoá tay.
# Có bước lỗi → thoát mã 1.
# Không gỡ Node, ffmpeg, Chrome, Git (máy có thể đang dùng cho việc khác): gỡ trong Settings > Apps nếu muốn.
# File này phải lưu UTF-8 có BOM (Windows PowerShell 5.1 mới đọc đúng chữ có dấu).
param([switch]$Purge, [switch]$Yes, [switch]$DryRun)
$ErrorActionPreference = 'Stop'
try { $utf8 = New-Object System.Text.UTF8Encoding $false; [Console]::OutputEncoding = $utf8; $OutputEncoding = $utf8 } catch { }
$BaseDir = Join-Path $env:LOCALAPPDATA 'LumReels'
$AppDir = Join-Path $BaseDir 'app'
$UserData = $(if ($env:LUMREELS_HOME) { $env:LUMREELS_HOME } else { Join-Path $HOME '.lumreels' })
$links = @((Join-Path ([Environment]::GetFolderPath('Desktop')) 'LumReels.lnk'), (Join-Path ([Environment]::GetFolderPath('Programs')) 'LumReels.lnk'))
$script:Failed = 0
function Say([string]$kind, [string]$msg) {
switch ($kind) {
'ok' { Write-Host (' ✓ ' + $msg) -ForegroundColor Green }
'fail' { Write-Host (' ✗ ' + $msg) -ForegroundColor Red; $script:Failed++ }
'plan' { Write-Host (' → ' + $msg) -ForegroundColor Cyan }
default { Write-Host (' ' + $msg) }
}
}
# Thư mục dữ liệu được phép xoá bằng -Purge? Trả '' nếu được, hoặc lý do từ chối.
function Test-PurgeTarget([string]$dir) {
try { $full = [System.IO.Path]::GetFullPath($dir).TrimEnd('\', '/') } catch { return 'đường dẫn không hợp lệ' }
if (-not $full -or $full.Length -le 3) { return 'là gốc ổ đĩa' }
$protected = @($HOME, $env:USERPROFILE, $env:LOCALAPPDATA, $env:APPDATA, $env:ProgramFiles, ${env:ProgramFiles(x86)}, $env:SystemRoot, $env:ProgramData, $env:PUBLIC,
[Environment]::GetFolderPath('Desktop'), [Environment]::GetFolderPath('MyDocuments')) | Where-Object { $_ } | ForEach-Object { [System.IO.Path]::GetFullPath($_).TrimEnd('\', '/') }
foreach ($p in $protected) {
if ($full -ieq $p) { return "là thư mục hệ thống/người dùng ($p)" }
if ($p.StartsWith($full + '\', [System.StringComparison]::OrdinalIgnoreCase)) { return "chứa thư mục hệ thống/người dùng ($p)" }
}
if ((Split-Path -Leaf $full) -notmatch 'lumreels') { return 'tên thư mục không có chữ "lumreels"' }
return ''
}
Write-Host ''
Write-Host 'Gỡ LumReels' -ForegroundColor White
if ($DryRun) { Write-Host '(chạy thử -DryRun: không xoá gì)' -ForegroundColor Cyan }
Write-Host (" Sẽ xoá: $BaseDir và shortcut LumReels")
$purgeWhy = $(if ($Purge) { Test-PurgeTarget $UserData } else { '' })
if ($Purge -and $purgeWhy) { Say 'fail' "-Purge: KHÔNG xoá $UserData vì $purgeWhy. Kiểm tra biến LUMREELS_HOME, tự xoá tay nếu chắc chắn. Dừng, chưa gỡ gì."; if ($PSCommandPath) { exit 1 } else { return } }
elseif ($Purge) { Write-Host (" -Purge: xoá luôn dữ liệu người dùng $UserData và video đã dựng") -ForegroundColor Yellow }
else { Write-Host (" Giữ lại: $UserData (khoá AI, giọng, gói mẫu) + video đã dựng") }
if (-not $Yes -and -not $DryRun) {
$a = Read-Host ' Gõ Y rồi Enter để gỡ'
if ($a -notmatch '^\s*[yY]') { Say 'info' 'Đã huỷ, không xoá gì.'; if ($PSCommandPath) { exit 0 } else { return } }
}
# 1. tắt server LumReels do launcher bật (PID ghi ở server.pid), chỉ khi đúng là node chạy server/server.mjs
$procs = @()
$pidFile = Join-Path $BaseDir 'server.pid'
if (Test-Path -LiteralPath $pidFile) {
try {
$id = [int](Get-Content -LiteralPath $pidFile -TotalCount 1)
$procs = @(Get-CimInstance Win32_Process -Filter "ProcessId=$id" | Where-Object { $_.Name -eq 'node.exe' -and $_.CommandLine -match 'server[\/]server\.mjs' })
} catch { }
}
foreach ($p in $procs) {
if ($DryRun) { Say 'plan' "Sẽ tắt server LumReels (PID $($p.ProcessId))" }
else { try { Stop-Process -Id $p.ProcessId -Force; Start-Sleep -Milliseconds 500; Say 'ok' "Đã tắt server LumReels (PID $($p.ProcessId))" } catch { Say 'fail' "Không tắt được PID $($p.ProcessId): $($_.Exception.Message)" } }
}
# 2. giữ video đã dựng
if (-not $Purge -and (Test-Path -LiteralPath $AppDir)) {
$keep = @('jobs', 'edits') | ForEach-Object { Join-Path $AppDir $_ } | Where-Object { (Test-Path -LiteralPath $_) -and (Get-ChildItem -LiteralPath $_ -Force | Select-Object -First 1) }
if ($keep) {
$bk = Join-Path $UserData ('backup-' + (Get-Date -Format 'yyyyMMdd-HHmmss'))
foreach ($k in $keep) {
if ($DryRun) { Say 'plan' "Sẽ chuyển $k → $bk" }
else {
try {
New-Item -ItemType Directory -Force -Path $bk | Out-Null
Move-Item -LiteralPath $k -Destination $bk
Say 'ok' "Đã giữ $(Split-Path -Leaf $k) ở $bk"
} catch { Say 'fail' ("Không chuyển được $k sang $bk (" + $_.Exception.Message + '). Dừng gỡ để không mất video.'); if ($PSCommandPath) { exit 1 } else { return } }
}
}
}
}
# 3. shortcut + thư mục app
foreach ($l in $links) {
if (Test-Path -LiteralPath $l) {
if ($DryRun) { Say 'plan' "Sẽ xoá $l" } else { try { Remove-Item -LiteralPath $l -Force; Say 'ok' "Đã xoá $l" } catch { Say 'fail' "Không xoá được $l" } }
}
}
if (Test-Path -LiteralPath $BaseDir) {
if ($DryRun) { Say 'plan' "Sẽ xoá $BaseDir" }
else {
try { Remove-Item -LiteralPath $BaseDir -Recurse -Force; Say 'ok' "Đã xoá $BaseDir" }
catch { Say 'fail' ("Chưa xoá hết $BaseDir (" + $_.Exception.Message + '). Tắt LumReels/trình duyệt đang mở file trong đó rồi chạy lại.') }
}
} else { Say 'ok' 'Không còn thư mục app' }
# 4. dữ liệu người dùng
if ($Purge -and -not $purgeWhy -and (Test-Path -LiteralPath $UserData)) {
if ($DryRun) { Say 'plan' "Sẽ xoá $UserData" }
else { try { Remove-Item -LiteralPath $UserData -Recurse -Force; Say 'ok' "Đã xoá $UserData" } catch { Say 'fail' ("Chưa xoá hết $UserData (" + $_.Exception.Message + ')') } }
}
Write-Host ''
Say 'info' 'Node, ffmpeg, Chrome, Git vẫn giữ nguyên. Gỡ trong Settings > Apps nếu không dùng nữa.'
$code = $(if ($script:Failed) { 1 } else { 0 })
if ($script:Failed) { Write-Host (" Có $($script:Failed) bước lỗi (xem ✗ ở trên).") -ForegroundColor Red }
if ($PSCommandPath) { exit $code }