Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

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

Divanshu Grover170043a58da9
diff --git a/install.ps1 b/install.ps1
index 729db3836..a1ce69eba 100644
--- a/install.ps1
+++ b/install.ps1
@@ -47,14 +47,39 @@ 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"
+ }
+
# 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 "& {
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 ""
@@ -67,21 +92,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
}
diff --git a/screenpipe-core/src/ffmpeg.rs b/screenpipe-core/src/ffmpeg.rs
index de95a8487..c73c1466a 100644
--- a/screenpipe-core/src/ffmpeg.rs
+++ b/screenpipe-core/src/ffmpeg.rs
@@ -4,7 +4,7 @@ use ffmpeg_sidecar::{
paths::sidecar_dir,
version::ffmpeg_version,
};
-use log::{debug, error};
+use log::{debug, error, info};
use once_cell::sync::Lazy;
use std::path::PathBuf;
use which::which;
@@ -136,7 +136,7 @@ fn handle_ffmpeg_installation() -> Result<(), anyhow::Error> {
return Ok(());
}
- debug!("ffmpeg not found. installing...");
+ info!("ffmpeg not found. installing...");
match check_latest_version() {
Ok(version) => debug!("latest version: {}", version),
Err(e) => debug!("skipping version check due to error: {e}"),
@@ -145,7 +145,7 @@ fn handle_ffmpeg_installation() -> Result<(), anyhow::Error> {
let download_url = ffmpeg_download_url()?;
let destination = get_ffmpeg_install_dir()?;
- debug!("downloading from: {:?}", download_url);
+ info!("downloading from: {:?}", download_url);
let archive_path = download_ffmpeg_package(download_url, &destination)?;
debug!("downloaded package: {:?}", archive_path);
@@ -154,7 +154,7 @@ fn handle_ffmpeg_installation() -> Result<(), anyhow::Error> {
let version = ffmpeg_version()?;
- debug!("done! installed ffmpeg version {}", version);
+ info!("done! installed ffmpeg version {}", version);
Ok(())
}