From 9c01398cd4de7e1eab1b5acd9f08cbd6402e8ada Mon Sep 17 00:00:00 2001 From: Revela Date: Sun, 15 Mar 2026 08:50:39 -0500 Subject: [PATCH] Refactor zip creation using .NET Compression library Updated the zipping process to utilize .NET's `System.IO.Compression` library for improved cross-platform compatibility. The new implementation creates a temporary zip file, removes unwanted entries (e.g., `.pch` and `.zip` files), and then finalizes the zip file, ensuring it only contains the desired files. --- Update-NightlyRelease.ps1 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Update-NightlyRelease.ps1 b/Update-NightlyRelease.ps1 index 6b6e7574..0b75dbce 100644 --- a/Update-NightlyRelease.ps1 +++ b/Update-NightlyRelease.ps1 @@ -59,10 +59,19 @@ if (Test-Path $ZipPath) { Remove-Item $ZipPath -Force } -# Gather all files/folders, excluding .pch files and any existing zip -$itemsToZip = Get-ChildItem -Path $ReleaseDir -Exclude "*.pch", "*.zip" +# Use .NET ZipFile for reliable cross-platform zip structure +Add-Type -AssemblyName System.IO.Compression.FileSystem -Compress-Archive -Path $itemsToZip.FullName -DestinationPath $ZipPath -CompressionLevel Optimal +$tempZip = "$ZipPath.tmp" +[System.IO.Compression.ZipFile]::CreateFromDirectory($ReleaseDir, $tempZip, [System.IO.Compression.CompressionLevel]::Optimal, $false) + +# Rewrite the zip without .pch files +$zipIn = [System.IO.Compression.ZipFile]::Open($tempZip, 'Update') +$toRemove = $zipIn.Entries | Where-Object { $_.FullName -like "*.pch" -or $_.FullName -like "*.zip" } +foreach ($entry in $toRemove) { $entry.Delete() } +$zipIn.Dispose() + +Move-Item -Path $tempZip -Destination $ZipPath -Force Write-Host " Created: $ZipPath" -ForegroundColor Green # --- Step 3: Get the Nightly release info ---