-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.ps1
More file actions
88 lines (76 loc) · 3.79 KB
/
install.ps1
File metadata and controls
88 lines (76 loc) · 3.79 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
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
80
81
82
83
84
85
86
87
88
# Install script for pull-vids on Windows
# Run this in PowerShell as Administrator
$ErrorActionPreference = "Stop"
$REPO = "vib795/pull-vids"
$BINARY_NAME = "pull-vids.exe"
$INSTALL_DIR = "$env:ProgramFiles\pull-vids"
Write-Host "╔═══════════════════════════════════════╗" -ForegroundColor Cyan
Write-Host "║ pull-vids Installation Script ║" -ForegroundColor Cyan
Write-Host "╚═══════════════════════════════════════╝" -ForegroundColor Cyan
Write-Host ""
# Check if running as Administrator
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
if (-not $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host "✗ This script must be run as Administrator" -ForegroundColor Red
Write-Host " Right-click PowerShell and select 'Run as Administrator'" -ForegroundColor Yellow
exit 1
}
Write-Host "Detected platform: Windows AMD64" -ForegroundColor Yellow
Write-Host ""
# Get latest release
Write-Host "Fetching latest release..." -ForegroundColor Cyan
try {
$release = Invoke-RestMethod -Uri "https://api.github.com/repos/$REPO/releases/latest"
$version = $release.tag_name
Write-Host "✓ Latest release: $version" -ForegroundColor Green
} catch {
Write-Host "✗ Failed to fetch latest release" -ForegroundColor Red
Write-Host " Building from source not yet supported on Windows" -ForegroundColor Yellow
exit 1
}
# Download binary
$downloadUrl = "https://github.com/$REPO/releases/download/$version/$BINARY_NAME"
$tempFile = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), $BINARY_NAME)
Write-Host "Downloading binary..." -ForegroundColor Cyan
try {
Invoke-WebRequest -Uri $downloadUrl -OutFile $tempFile
Write-Host "✓ Download complete" -ForegroundColor Green
} catch {
Write-Host "✗ Download failed" -ForegroundColor Red
exit 1
}
# Create installation directory
Write-Host "Installing to $INSTALL_DIR..." -ForegroundColor Cyan
if (-not (Test-Path $INSTALL_DIR)) {
New-Item -ItemType Directory -Path $INSTALL_DIR | Out-Null
}
# Copy binary
Copy-Item -Path $tempFile -Destination "$INSTALL_DIR\$BINARY_NAME" -Force
Remove-Item -Path $tempFile
# Add to PATH if not already there
$currentPath = [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine)
if ($currentPath -notlike "*$INSTALL_DIR*") {
Write-Host "Adding to system PATH..." -ForegroundColor Cyan
[Environment]::SetEnvironmentVariable(
"Path",
"$currentPath;$INSTALL_DIR",
[EnvironmentVariableTarget]::Machine
)
Write-Host "✓ Added to PATH" -ForegroundColor Green
}
Write-Host ""
Write-Host "╔═══════════════════════════════════════╗" -ForegroundColor Green
Write-Host "║ ✓ Installation completed! ║" -ForegroundColor Green
Write-Host "╚═══════════════════════════════════════╝" -ForegroundColor Green
Write-Host ""
Write-Host "Run 'pull-vids --help' to get started!" -ForegroundColor Yellow
Write-Host "(You may need to restart your terminal)" -ForegroundColor Yellow
Write-Host ""
Write-Host "Note: You also need to install:" -ForegroundColor Cyan
Write-Host " - ffmpeg (for video processing)" -ForegroundColor White
Write-Host " - yt-dlp (for downloading from 1000+ sites)" -ForegroundColor White
Write-Host ""
Write-Host "Install dependencies:" -ForegroundColor Cyan
Write-Host " winget install ffmpeg" -ForegroundColor Yellow
Write-Host " pip install yt-dlp" -ForegroundColor Yellow
Write-Host ""