Improve error handling in PowerShell build script and update icon path in main.py to use resource from public folder.

This commit is contained in:
Miguel 2025-08-26 10:40:24 +02:00
parent ed7ff2d571
commit 228b0deb24
2 changed files with 8 additions and 7 deletions

View File

@ -32,7 +32,7 @@ try {
npm run build
Write-Host "Frontend build completed" -ForegroundColor Green
} catch {
Write-Host "Frontend build failed: $_" -ForegroundColor Red
Write-Host "Frontend build failed: $($_.Exception.Message)" -ForegroundColor Red
exit 1
}
@ -88,7 +88,7 @@ try {
$pythonProcesses | Stop-Process -Force -ErrorAction SilentlyContinue
Write-Host "All Python processes terminated." -ForegroundColor Green
} catch {
Write-Host "Warning: Some processes could not be terminated: $_" -ForegroundColor Yellow
Write-Host "Warning: Some processes could not be terminated: $($_.Exception.Message)" -ForegroundColor Yellow
}
Start-Sleep -Seconds 2
@ -116,7 +116,7 @@ try {
Write-Host " Invalid index: $index" -ForegroundColor Red
}
} catch {
Write-Host " Could not terminate process $index: $_" -ForegroundColor Red
Write-Host " Could not terminate process $index`: $($_.Exception.Message)" -ForegroundColor Red
}
}
} else {
@ -132,7 +132,7 @@ try {
}
} catch {
Write-Host "PyInstaller build failed: $_" -ForegroundColor Red
Write-Host "PyInstaller build failed: $($_.Exception.Message)" -ForegroundColor Red
exit 1
}
@ -192,7 +192,7 @@ try {
} catch {
$retryCount++
Write-Host "Compression attempt $retryCount failed: $_" -ForegroundColor Yellow
Write-Host "Compression attempt $retryCount failed: $($_.Exception.Message)" -ForegroundColor Yellow
if ($retryCount -eq $maxRetries) {
# Final attempt: try creating a copy first, then compress
@ -259,7 +259,7 @@ try {
}
} catch {
Write-Host "Compression failed: $_" -ForegroundColor Red
Write-Host "Compression failed: $($_.Exception.Message)" -ForegroundColor Red
exit 1
}

View File

@ -3358,7 +3358,8 @@ def main():
time.sleep(2)
# Setup and run the system tray icon
icon_path = project_path("frontend", "src", "assets", "logo", "record.png")
# Use the icon from public folder (included in frontend/dist build)
icon_path = resource_path(os.path.join("frontend", "dist", "record.png"))
try:
image = Image.open(icon_path)
menu = pystray.Menu(