forked from mediar-ai/screenpipe
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.ps1
79 lines (65 loc) · 3.95 KB
/
install.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Write-Host "installing screenpipe..."
try {
# Get latest version
$releases = Invoke-RestMethod "https://api.github.com/repos/mediar-ai/screenpipe/releases"
$latestRelease = $releases | Where-Object { -not $_.prerelease } | Select-Object -First 1
if (-not $latestRelease) {
throw "no releases found"
}
# Find the Windows asset
$asset = $latestRelease.assets | Where-Object { $_.name -like "*-x86_64-pc-windows-msvc.zip" } | Select-Object -First 1
if (-not $asset) {
throw "no Windows release found in version $($latestRelease.tag_name)"
}
$url = $asset.browser_download_url
$installDir = "$env:USERPROFILE\screenpipe"
$tempZip = "$env:TEMP\screenpipe.zip"
# Download and extract
Write-Host "downloading latest version ($($latestRelease.tag_name)) from $url..."
Invoke-WebRequest -Uri $url -OutFile $tempZip
# Create install directory if it doesn't exist
if (!(Test-Path $installDir)) {
New-Item -ItemType Directory -Path $installDir | Out-Null
}
Write-Host "extracting..."
Expand-Archive -Path $tempZip -DestinationPath $installDir -Force
# Add to PATH if not already there
$currentPath = [Environment]::GetEnvironmentVariable("Path", "User")
if ($currentPath -notlike "*$installDir\bin*") {
[Environment]::SetEnvironmentVariable("Path", "$currentPath;$installDir\bin", "User")
$env:Path = [Environment]::GetEnvironmentVariable("Path", "User")
}
# Verify installation
$binPath = Join-Path $installDir "bin\screenpipe.exe"
if (!(Test-Path $binPath)) {
throw "screenpipe.exe not found in $binPath after installation"
}
# Cleanup
Remove-Item $tempZip -Force
# Install bun
Write-Host "installing bun..."
powershell -c "irm bun.sh/install.ps1|iex"
Write-Host @"
███████╗ ██████╗██████╗ ███████╗███████╗███╗ ██╗██████╗ ██╗██████╗ ███████╗
██╔════╝██╔════╝██╔══██╗██╔════╝██╔════╝████╗ ██║██╔══██╗██║██╔══██╗██╔════╝
███████╗██║ ██████╔╝█████╗ █████╗ ██╔██╗ ██║█████╔╝██║██████╔╝█████╗
╚════██║██║ ██╔══██╗██╔══╝ ██╔══╝ ██║╚██╗██║██╔═══╝ ██║██╔═══╝ ██╔══╝
███████║╚██████╗██║ ██║███████╗███████╗██║ ╚████║██║ ██║██║ ███████╗
╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚══════╝
"@
Write-Host "installation complete! 🚀"
Write-Host "to get started:"
Write-Host "1. restart your terminal"
Write-Host "2. run: screenpipe"
Write-Host ""
Write-Host "╭──────────────────────────────────────────╮"
Write-Host "│ join our discord: │"
Write-Host "│ --> https://discord.gg/dU9EBuw7Uq │"
Write-Host "│ │"
Write-Host "│ check the docs: │"
Write-Host "│ --> https://docs.screenpi.pe │"
Write-Host "╰──────────────────────────────────────────╯"
} catch {
Write-Host "installation failed: $($_.Exception.Message)" -ForegroundColor Red
exit 1
}