updatedd zip_full.ps1 top pick only the latest file by LastWriteTime

This commit is contained in:
dzaitsev
2025-05-23 12:11:48 +03:00
parent d90b2750e0
commit e957f1192a
+8 -9
View File
@@ -1,4 +1,3 @@
# zip_full.ps1
$host.UI.RawUI.WindowTitle = "Full Installer Zipper"
Write-Host "`n===== [AZAION SUITE FULL PACKAGER] =====" -ForegroundColor Cyan
@@ -26,17 +25,17 @@ Set-Location ..
$currentDir = Get-Location
Write-Host "[INFO] Working directory: $currentDir" -ForegroundColor Gray
# Locate Full EXE
$fullExe = Get-ChildItem -Filter "AzaionSuite.Full.*.exe" | Select-Object -First 1
# 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
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
Write-Host "[OK] Found Full EXE: $($fullExe.Name)" -ForegroundColor Green
# Match BIN files
# Match BIN files with same base name
$baseName = [System.IO.Path]::GetFileNameWithoutExtension($fullExe.Name)
$binFiles = Get-ChildItem -Filter "$baseName-*.bin"
@@ -60,10 +59,10 @@ 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
Write-Host "[SUCCESS] ZIP archive created successfully: $zipName" -ForegroundColor Green
} catch {
Write-Host "[ERROR] Failed to create ZIP archive: $_" -ForegroundColor Red
Write-Host "[ERROR] Failed to create ZIP archive: $_" -ForegroundColor Red
exit 1
}
Write-Host "`n[FINISHED] Full installer packaging complete." -ForegroundColor Cyan
Write-Host "`n[FINISHED] Full installer packaging complete." -ForegroundColor Cyan