# AI Memory Engine Installation Script
# Run with: powershell -ExecutionPolicy Bypass -File install.ps1
Write-Host "๐ง AI Memory Engine Installer" -ForegroundColor Cyan
Write-Host "================================" -ForegroundColor Cyan
# Check if running as administrator
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
if (-not $isAdmin) {
Write-Host "โ ๏ธ Running without administrator privileges" -ForegroundColor Yellow
Write-Host " Installing to user directory instead of system-wide" -ForegroundColor Yellow
}
# Determine install directory
if ($isAdmin) {
$installDir = "C:\Program Files\AIMemoryEngine"
} else {
$installDir = "$env:LOCALAPPDATA\AIMemoryEngine"
}
Write-Host "๐ Install directory: $installDir" -ForegroundColor Green
# Create install directory
if (-not (Test-Path $installDir)) {
New-Item -ItemType Directory -Path $installDir -Force | Out-Null
Write-Host "โ
Created install directory" -ForegroundColor Green
}
# Copy binary
$sourceBinary = ".\target\release\aimemoryengine.exe"
$targetBinary = "$installDir\aimemoryengine.exe"
if (Test-Path $sourceBinary) {
Copy-Item $sourceBinary $targetBinary -Force
Write-Host "โ
Copied aimemoryengine.exe" -ForegroundColor Green
} else {
Write-Host "โ Binary not found at $sourceBinary" -ForegroundColor Red
Write-Host " Please run 'cargo build --release' first" -ForegroundColor Red
exit 1
}
# Add to PATH
$currentPath = [Environment]::GetEnvironmentVariable("PATH", "User")
if ($currentPath -notlike "*$installDir*") {
[Environment]::SetEnvironmentVariable("PATH", "$currentPath;$installDir", "User")
Write-Host "โ
Added to PATH (restart terminal to take effect)" -ForegroundColor Green
} else {
Write-Host "โ
Already in PATH" -ForegroundColor Green
}
# Test installation
Write-Host ""
Write-Host "๐งช Testing installation..." -ForegroundColor Cyan
& "$targetBinary" --help | Out-Null
if ($LASTEXITCODE -eq 0) {
Write-Host "โ
Installation successful!" -ForegroundColor Green
} else {
Write-Host "โ Installation test failed" -ForegroundColor Red
exit 1
}
Write-Host ""
Write-Host "๐ AI Memory Engine installed successfully!" -ForegroundColor Green
Write-Host ""
Write-Host "Next steps:" -ForegroundColor Cyan
Write-Host "1. Restart your terminal" -ForegroundColor White
Write-Host "2. Run: aimemoryengine license activate 'your-license-key'" -ForegroundColor White
Write-Host "3. Run: aimemoryengine init" -ForegroundColor White
Write-Host ""
Write-Host "Need help? Visit: https://aimemoryengine.com/docs" -ForegroundColor Cyan