Skip to content

make sure user know that ffmpeg is being downloaded and do not re-install bun #1591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 14, 2025
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 60 additions & 13 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,59 @@ try {
# Cleanup
Remove-Item $tempZip -Force

# Install bun
Write-Host "installing bun..."
powershell -c "irm bun.sh/install.ps1|iex"
# Check if bun is installed
$bunInstalled = $false
$bunVersion = ""

try {
$bunVersion = (bun --version 2>$null) -replace "[^\d\.]", ""
if ($bunVersion -as [version] -ge [version]"1.1.43") {
$bunInstalled = $true
}
}
catch {}

if ($bunInstalled) {
Write-Host "Bun is already installed and meets version requirements"
}
else {
Write-Host "Installing bun..."
powershell -c "irm bun.sh/install.ps1|iex"
}

# Check if ffmpeg is installed
$ffmpegInstalled = $false

try {
$ffmpegVersion = ffmpeg -version 2>$null
if ($ffmpegVersion) {
$ffmpegInstalled = $true
}
}
catch {}

if ($ffmpegInstalled) {
Write-Host "FFmpeg is installed."
}
else {
Write-Host "FFmpeg is required but not found in PATH."
Write-Host "You can install it using: `"winget install FFmpeg (Essentials Build)`""
}


# Install Visual Studio Redistributables to avoid any ort issues
Write-Host "Installing Visual Studio Redistributables..."
Write-Host ""
# Inform the user about the need for elevation
Write-Host "The script requires administrative privileges. You will be prompted to allow this action."

Start-Process powershell -Verb RunAs -ArgumentList @"
-NoProfile -ExecutionPolicy Bypass -Command "& {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was the reason

image

Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://vcredist.com/install.ps1'))
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://vcredist.com/install.ps1'))
}"
"@

Write-Host "Installation Complete"
Write-Host ""
Expand All @@ -67,21 +112,23 @@ try {

try {
$postHogData = @{
api_key = "phc_Bt8GoTBPgkCpDrbaIZzJIEYt0CrJjhBiuLaBck1clce"
event = "cli_install"
api_key = "phc_Bt8GoTBPgkCpDrbaIZzJIEYt0CrJjhBiuLaBck1clce"
event = "cli_install"
properties = @{
distinct_id = $env:COMPUTERNAME
version = $latestRelease.tag_name
os = "windows"
arch = "x86_64"
}
} | ConvertTo-Json
version = $latestRelease.tag_name
os = "windows"
arch = "x86_64"
}
} | ConvertTo-Json
Invoke-RestMethod -Uri "https://eu.i.posthog.com/capture/" -Method Post -Body $postHogData -ContentType "application/json"
} catch {
}
catch {
# Silently continue if tracking fails
}

} catch {
}
catch {
Write-Host "installation failed: $($_.Exception.Message)" -ForegroundColor Red
exit 1
}
Loading