diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index d2c67ef..8cfbec3 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -64,11 +64,13 @@ jobs: # Update setup.py $setupContent = Get-Content "build/windows/setup.py" -Raw $setupContent = $setupContent -replace 'version="[^"]*"', "version=`"$version`"" + $setupContent = $setupContent -replace 'target_name="[^"]*"', "target_name=`"YTSage-v$version.exe`"" Set-Content "build/windows/setup.py" -Value $setupContent # Update setup-ffmpeg.py $setupFFmpegContent = Get-Content "build/windows/setup-ffmpeg.py" -Raw $setupFFmpegContent = $setupFFmpegContent -replace 'version="[^"]*"', "version=`"$version`"" + $setupFFmpegContent = $setupFFmpegContent -replace 'target_name="[^"]*"', "target_name=`"YTSage-v$version-ffmpeg.exe`"" Set-Content "build/windows/setup-ffmpeg.py" -Value $setupFFmpegContent Write-Host "Version updated in setup files (build script auto-detects version)" @@ -81,6 +83,7 @@ jobs: # Clean previous build artifacts if (Test-Path "build\exe.*") { Remove-Item "build\exe.*" -Recurse -Force } + if (Test-Path "build\bdist.*") { Remove-Item "build\bdist.*" -Recurse -Force } if (Test-Path "dist") { Remove-Item "dist" -Recurse -Force } # Build executable @@ -88,13 +91,38 @@ jobs: # Build MSI installer with error handling Write-Host "Building standard MSI installer..." - python build\windows\setup.py bdist_msi + Write-Host "Current working directory: $(Get-Location)" + Write-Host "Setup.py path: $(Resolve-Path 'build\windows\setup.py')" + + # Run with maximum verbosity to capture any hidden errors + python build\windows\setup.py bdist_msi --verbose if ($LASTEXITCODE -eq 0) { Write-Host "Standard MSI build completed successfully" # List MSI files created Write-Host "MSI files in dist directory after standard build:" if (Test-Path "dist") { - Get-ChildItem -Path "dist" -Filter "*.msi" | ForEach-Object { Write-Host " $($_.Name)" } + $msiFiles = Get-ChildItem -Path "dist" -Filter "*.msi" + if ($msiFiles) { + $msiFiles | ForEach-Object { Write-Host " $($_.Name)" } + } else { + Write-Host " No MSI files found! Attempting alternative build method..." + # Alternative approach: try building without excludes that might cause issues + Write-Host "Retrying MSI build with simplified configuration..." + python build\windows\setup.py bdist_msi --skip-build + if (Test-Path "dist/*.msi") { + Write-Host "Alternative MSI build succeeded!" + Get-ChildItem -Path "dist" -Filter "*.msi" | ForEach-Object { Write-Host " $($_.Name)" } + } else { + Write-Host "ERROR: MSI creation failed completely. Build directory contents:" + if (Test-Path "build") { + Get-ChildItem -Path "build" -Recurse | ForEach-Object { Write-Host " $($_.FullName)" } + } + exit 1 + } + } + } else { + Write-Host " No dist directory found!" + exit 1 } } else { Write-Host "Error building standard MSI - exit code: $LASTEXITCODE" @@ -159,6 +187,7 @@ jobs: # Clean previous build artifacts if (Test-Path "build\exe.*") { Remove-Item "build\exe.*" -Recurse -Force } + if (Test-Path "build\bdist.*") { Remove-Item "build\bdist.*" -Recurse -Force } if (Test-Path "dist\*.msi") { Remove-Item "dist\*.msi" -Force } # Build executable with FFmpeg diff --git a/build/windows/setup-ffmpeg.py b/build/windows/setup-ffmpeg.py index 47b98ec..babf595 100644 --- a/build/windows/setup-ffmpeg.py +++ b/build/windows/setup-ffmpeg.py @@ -86,18 +86,12 @@ build_exe_options = { "build_exe": "dist/YTSage-FFmpeg", # Output directory for executable } -# MSI build options +# MSI build options - simplified to avoid cx_Freeze issues bdist_msi_options = { "upgrade_code": "{87654321-4321-8765-CBA9-987654321CBA}", # Different GUID for FFmpeg version "add_to_path": False, - "initial_target_dir": r"[ProgramFilesFolder]\YTSage", - # 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 with FFmpeg - Complete video processing solution", - "keywords": "youtube, downloader, video, audio, converter, ffmpeg" - } + "initial_target_dir": r"[ProgramFilesFolder]\YTSage" + # Removed summary_data that might cause silent failures } # Base configuration for Windows GUI application @@ -110,7 +104,7 @@ executable = Executable( "main.py", base=base, icon="assets/branding/icons/YTSage.ico", - target_name="YTSage-v4.8.0-ffmpeg.exe", + target_name="YTSage-v4.7.4-ffmpeg.exe", copyright="Copyright (c) 2024-2025 YTSage", trademarks="YTSage" ) @@ -118,7 +112,7 @@ executable = Executable( # Setup configuration setup( name="YTSage-FFmpeg", - version="4.8.0", + version="4.7.4", # Updated to match expected version description="YouTube Video Downloader with FFmpeg", author="oop7", author_email="oop7_support@proton.me", diff --git a/build/windows/setup.py b/build/windows/setup.py index 56ba639..2c4ad1d 100644 --- a/build/windows/setup.py +++ b/build/windows/setup.py @@ -69,18 +69,12 @@ build_exe_options = { "build_exe": "dist/YTSage", # Output directory for executable } -# MSI build options +# MSI build options - simplified to avoid cx_Freeze issues bdist_msi_options = { "upgrade_code": "{12345678-1234-5678-9ABC-123456789ABC}", # Generate unique GUID "add_to_path": False, - "initial_target_dir": r"[ProgramFilesFolder]\YTSage", - # 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", - "keywords": "youtube, downloader, video, audio, converter" - } + "initial_target_dir": r"[ProgramFilesFolder]\YTSage" + # Removed target_name and summary_data that might cause silent failures } # Base configuration for Windows GUI application @@ -93,7 +87,7 @@ executable = Executable( "main.py", base=base, icon="assets/branding/icons/YTSage.ico", - target_name="YTSage-v4.8.0.exe", + target_name="YTSage-v4.7.4.exe", copyright="Copyright (c) 2024-2025 YTSage", trademarks="YTSage" ) @@ -101,7 +95,7 @@ executable = Executable( # Setup configuration setup( name="YTSage", - version="4.8.0", + version="4.7.4", # Updated to match expected version description="YouTube Video Downloader", author="oop7", author_email="oop7_support@proton.me",