# CapsBro installer for Adobe Premiere Pro (Windows). # # Run it from PowerShell with one line (the website shows the exact line): # irm https://capsbro.pages.dev/install | iex # # What it does: # 1. Downloads the CapsBro panel (a few hundred KB) from the CapsBro server # and checks every file against its SHA-256. # 2. Puts it in your user's Premiere extensions folder: # %APPDATA%\Adobe\CEP\extensions\com.capsbro.premiere # 3. Remembers which release channel it came from. # No administrator rights, no .exe, nothing runs in the background. The panel # sets up its AI engine by itself the first time you open it in Premiere. # # The channel, server and site addresses below are filled in when the website is built. & { $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' $Channel = 'stable' $Cdn = 'https://rosybrown-spoonbill-256117.hostingersite.com/capsbro/' $Site = 'https://capsbro.pages.dev' $BundleId = 'com.capsbro.premiere' function Say([string]$Text, [string]$Color = 'Gray') { Write-Host $Text -ForegroundColor $Color } function Step([string]$Text) { Write-Host (' > ' + $Text) -ForegroundColor White } try { # Windows PowerShell 5.1 may still default to old TLS versions. [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 Write-Host '' Say ' CapsBro for Premiere Pro' 'Magenta' Say ' Automatic captions, right inside Premiere.' 'DarkGray' Write-Host '' if (-not [Environment]::Is64BitOperatingSystem) { throw 'CapsBro needs 64 bit Windows 10 or 11.' } $premiere = @(Get-ChildItem 'C:\Program Files\Adobe' -Directory -Filter 'Adobe Premiere Pro*' -ErrorAction SilentlyContinue) if ($premiere.Count -eq 0) { Say ' Note: Premiere Pro was not found in C:\Program Files\Adobe. CapsBro will appear once it is installed.' 'Yellow' } Step 'Checking the latest version' $stamp = [DateTimeOffset]::UtcNow.ToUnixTimeSeconds() $info = Invoke-RestMethod -Uri ($Cdn + 'c/' + $Channel + '.json?t=' + $stamp) -UseBasicParsing -TimeoutSec 60 if (-not $info.panel) { throw 'The CapsBro server has no panel to install right now. Please try again later.' } $manifest = Invoke-RestMethod -Uri ($Cdn + $info.panel.manifest) -UseBasicParsing -TimeoutSec 60 $temp = Join-Path $env:TEMP ('CapsBro-install-' + [Guid]::NewGuid().ToString('N').Substring(0, 8)) $stage = Join-Path $temp $BundleId New-Item -ItemType Directory -Force -Path $stage | Out-Null Step ('Downloading CapsBro ' + $manifest.version) $client = New-Object System.Net.WebClient $client.Headers.Add('User-Agent', 'CapsBro-Installer') foreach ($f in $manifest.files) { $dest = Join-Path $stage ($f.p -replace '/', '\') New-Item -ItemType Directory -Force -Path (Split-Path $dest -Parent) | Out-Null $url = $Cdn + 'o/' + $f.h.Substring(0, 2) + '/' + $f.h $ok = $false for ($try = 1; $try -le 4 -and -not $ok; $try++) { try { $client.DownloadFile($url, $dest) $hash = (Get-FileHash -Algorithm SHA256 -Path $dest).Hash.ToLowerInvariant() if ($hash -eq $f.h) { $ok = $true } else { Start-Sleep -Seconds $try } } catch { Start-Sleep -Seconds $try } } if (-not $ok) { throw ('Could not download ' + $f.p + '. Check your internet connection and run the command again.') } } $client.Dispose() Step 'Installing the panel' $extRoot = Join-Path $env:APPDATA 'Adobe\CEP\extensions' New-Item -ItemType Directory -Force -Path $extRoot | Out-Null $target = Join-Path $extRoot $BundleId if (Test-Path -LiteralPath $target) { $item = Get-Item -LiteralPath $target -Force if ($item.Attributes -band [IO.FileAttributes]::ReparsePoint) { # A link (a developer setup): remove the link only, never what it points to. [IO.Directory]::Delete($target, $false) } else { $old = $target + '.old' if (Test-Path -LiteralPath $old) { Remove-Item -LiteralPath $old -Recurse -Force } Rename-Item -LiteralPath $target -NewName ($BundleId + '.old') Remove-Item -LiteralPath $old -Recurse -Force -ErrorAction SilentlyContinue } } Move-Item -LiteralPath $stage -Destination $target Remove-Item -LiteralPath $temp -Recurse -Force -ErrorAction SilentlyContinue $data = Join-Path $env:LOCALAPPDATA 'CapsBro' New-Item -ItemType Directory -Force -Path $data | Out-Null $record = [ordered]@{ channel = $Channel; cdn = $Cdn; site = $Site; version = $manifest.version build = $manifest.build; installedAt = (Get-Date).ToUniversalTime().ToString('o') } [IO.File]::WriteAllText((Join-Path $data 'install.json'), ($record | ConvertTo-Json), (New-Object Text.UTF8Encoding($false))) Write-Host '' Say (' CapsBro ' + $manifest.version + ' is installed.') 'Green' Write-Host '' if (Get-Process -Name 'Adobe Premiere Pro' -ErrorAction SilentlyContinue) { Say ' Premiere Pro is open: close it and open it again.' 'Yellow' } Say ' Next: open Premiere Pro, then Window > Extensions > CapsBro.' 'White' Say ' The first time, CapsBro downloads its AI once (4 to 7 GB). It keeps going if you close Premiere,' 'DarkGray' Say ' and it can use another drive if C: is full.' 'DarkGray' Write-Host '' } catch { Write-Host '' Say (' CapsBro could not be installed: ' + $_.Exception.Message) 'Red' Say (' Need help? Visit ' + $Site) 'DarkGray' Write-Host '' } }