$host.UI.RawUI.WindowTitle = "Full Installer Zipper" Write-Host "`n===== [AZAION SUITE FULL PACKAGER] =====" -ForegroundColor Cyan function Show-ProgressBar { param ( [string]$Activity, [int]$Steps = 20, [int]$Delay = 30 ) for ($i = 1; $i -le $Steps; $i++) { $percent = [math]::Round(($i / $Steps) * 100) $bar = ("#" * $i).PadRight($Steps) Write-Host -NoNewline "`r[PROGRESS] $Activity [$bar] $percent% " Start-Sleep -Milliseconds $Delay } Write-Host "" } Write-Host "[INFO] Preparing to package Full installer..." -ForegroundColor Yellow Set-Location -Path (Split-Path -Parent $MyInvocation.MyCommand.Path) Set-Location .. $currentDir = Get-Location Write-Host "[INFO] Working directory: $currentDir" -ForegroundColor Gray # Locate latest Full EXE by LastWriteTime $fullExe = Get-ChildItem -Filter "AzaionSuite.Full.*.exe" | Sort-Object LastWriteTime -Descending | Select-Object -First 1 if (-not $fullExe) { Write-Host "[ERROR] No Full build EXE found (AzaionSuite.Full.*.exe)" -ForegroundColor Red exit 1 } Write-Host "[OK] Found Full EXE: $($fullExe.Name)" -ForegroundColor Green # Match BIN files with same base name $baseName = [System.IO.Path]::GetFileNameWithoutExtension($fullExe.Name) $binFiles = Get-ChildItem -Filter "$baseName-*.bin" if ($binFiles.Count -gt 0) { Write-Host "[INFO] Matching BIN files found:" -ForegroundColor Cyan $binFiles | ForEach-Object { Write-Host " - $_" -ForegroundColor DarkCyan } } else { Write-Host "[INFO] No BIN files found. Creating ZIP with only EXE." -ForegroundColor Yellow } # Compose final ZIP path $zipName = "$baseName.zip" $zipPath = Join-Path -Path $currentDir -ChildPath $zipName # Collect files to zip $toZip = @($fullExe.FullName) $toZip += $binFiles.FullName Write-Host "[INFO] Creating ZIP file: $zipName" -ForegroundColor Yellow Show-ProgressBar -Activity "Compressing files..." -Steps 25 -Delay 25 try { Compress-Archive -Force -Path $toZip -DestinationPath $zipPath -Verbose Write-Host "[SUCCESS] ZIP archive created successfully: $zipName" -ForegroundColor Green } catch { Write-Host "[ERROR] Failed to create ZIP archive: $_" -ForegroundColor Red exit 1 } Write-Host "`n[FINISHED] Full installer packaging complete." -ForegroundColor Cyan