Improve Windows build workflow error handling

Adds error handling to MSI installer creation steps in the Windows build workflow to prevent failures from stopping subsequent ZIP creation. Updates ZIP creation logic to use the dist output directory. Removes the install_icon option from setup.py to address potential MSI build issues.
This commit is contained in:
Your Name
2025-08-27 13:55:04 +03:00
parent 94601a0b8b
commit 17ec207852
2 changed files with 34 additions and 13 deletions
+32 -12
View File
@@ -86,15 +86,24 @@ jobs:
# Build executable
python build\windows\setup.py build
# Build MSI installer
python build\windows\setup.py bdist_msi
# Build MSI installer with error handling
Write-Host "Building standard MSI installer..."
try {
python build\windows\setup.py bdist_msi
Write-Host "Standard MSI build completed successfully"
} catch {
Write-Host "Error building standard MSI: $($_.Exception.Message)"
# Continue anyway to try ZIP creation
}
# Create ZIP distribution
$exeDir = Get-ChildItem -Path "build" -Directory -Filter "exe.*" | Select-Object -First 1
if ($exeDir) {
# Create ZIP distribution from dist output
$distDir = "dist\YTSage"
if (Test-Path $distDir) {
$version = "${{ steps.get_version.outputs.VERSION }}"
Compress-Archive -Path "$($exeDir.FullName)\*" -DestinationPath "dist\YTSage-v$version.zip" -Force
Compress-Archive -Path "$distDir\*" -DestinationPath "dist\YTSage-v$version.zip" -Force
Write-Host "Created ZIP: YTSage-v$version.zip"
} else {
Write-Host "Warning: Standard executable directory not found at $distDir"
}
- name: Setup FFmpeg for bundle
@@ -160,14 +169,25 @@ jobs:
# Build executable with FFmpeg
python build\windows\setup-ffmpeg.py build
# Build MSI installer with FFmpeg
python build\windows\setup-ffmpeg.py bdist_msi
# Build MSI installer with FFmpeg and error handling
Write-Host "Building FFmpeg MSI installer..."
try {
python build\windows\setup-ffmpeg.py bdist_msi
Write-Host "FFmpeg MSI build completed successfully"
} catch {
Write-Host "Error building FFmpeg MSI: $($_.Exception.Message)"
# Continue anyway to try ZIP creation
}
# Create ZIP distribution with FFmpeg
$exeDir = Get-ChildItem -Path "build" -Directory -Filter "exe.*" | Select-Object -First 1
if ($exeDir) {
# Create ZIP distribution with FFmpeg from dist output
$distDir = "dist\YTSage-FFmpeg"
if (Test-Path $distDir) {
$version = "${{ steps.get_version.outputs.VERSION }}"
Compress-Archive -Path "$($exeDir.FullName)\*" -DestinationPath "dist\YTSage-v$version-ffmpeg.zip" -Force
Compress-Archive -Path "$distDir\*" -DestinationPath "dist\YTSage-v$version-ffmpeg.zip" -Force
Write-Host "Created ZIP: YTSage-v$version-ffmpeg.zip"
} else {
Write-Host "Warning: FFmpeg executable directory not found at $distDir"
}
Write-Host "Created ZIP: YTSage-v$version-ffmpeg.zip"
}
+2 -1
View File
@@ -74,7 +74,8 @@ bdist_msi_options = {
"upgrade_code": "{12345678-1234-5678-9ABC-123456789ABC}", # Generate unique GUID
"add_to_path": False,
"initial_target_dir": r"[ProgramFilesFolder]\YTSage",
"install_icon": "assets/branding/icons/YTSage.ico",
# Remove problematic install_icon that might be causing MSI build to fail
# "install_icon": "assets/branding/icons/YTSage.ico",
"summary_data": {
"author": "oop7",
"comments": "YouTube Video Downloader - Easy to use video downloading tool",