diff --git a/pack-dist.ps1 b/pack-dist.ps1 index 0d99a4f..be0e441 100644 --- a/pack-dist.ps1 +++ b/pack-dist.ps1 @@ -289,22 +289,6 @@ glass may appear rotated. Source: https://gitea.mysticmachines.com/VWE/RP412 "@ -# --- the player's own files, back where they were -------------------------- -# Last, so the rebuilt tree cannot overwrite them. The zip below is taken -# from dist\, so a preserved file would otherwise travel to whoever gets the -# package - hence the copies are put back only when we are NOT zipping, and a -# release is always built from a folder with none of them in it. -if ($kept.Count -gt 0) { - if ($Zip) { - Write-Host " -Zip: leaving $($kept.Keys -join ', ') out, so the release ships clean" - } else { - foreach ($name in $kept.Keys) { - [System.IO.File]::WriteAllBytes((Join-Path $dist $name), $kept[$name]) - } - Write-Host " restored $($kept.Keys -join ', ')" - } -} - # --- summary / optional zip ------------------------------------------------ $size = (Get-ChildItem $dist -Recurse | Measure-Object Length -Sum).Sum Write-Host ("dist ready: {0:N1} MB" -f ($size / 1MB)) @@ -313,6 +297,10 @@ if ($Zip) { $zipPath = Join-Path $root "RedPlanet-$version.zip" Write-Host "zipping to $zipPath..." + # Taken BEFORE the player's files go back, so a release never carries + # somebody's callsign, key bindings or window positions to everyone who + # downloads it. A fresh unzip must look like a first run. + # # Everything lives under a single RP412\ folder inside the zip, so # unpacking anywhere gives one self-contained game directory instead # of scattering files into the extraction folder. @@ -323,3 +311,14 @@ if ($Zip) { Compress-Archive -Path "$stage\RP412" -DestinationPath $zipPath -Force Remove-Item -Recurse -Force $stage } + +# --- the player's own files, back where they were -------------------------- +# Last of all: after the rebuilt tree, so nothing the pack writes can land on +# top of them, and after the zip, so the release stays clean. Zipping should +# not cost you your own settings. +if ($kept.Count -gt 0) { + foreach ($name in $kept.Keys) { + [System.IO.File]::WriteAllBytes((Join-Path $dist $name), $kept[$name]) + } + Write-Host " restored $($kept.Keys -join ', ')" +}