diff --git a/pack-dist.ps1 b/pack-dist.ps1 index da17500..702e49e 100644 --- a/pack-dist.ps1 +++ b/pack-dist.ps1 @@ -275,5 +275,14 @@ Write-Host ("dist ready: {0:N1} MB" -f ($size / 1MB)) if ($Zip) { $zipPath = Join-Path $root 'RedPlanet-4.12.2.zip' Write-Host "zipping to $zipPath..." - Compress-Archive -Path "$dist\*" -DestinationPath $zipPath -Force + + # 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. + $stage = Join-Path ([System.IO.Path]::GetTempPath()) 'rp412-zipstage' + if (Test-Path $stage) { Remove-Item -Recurse -Force $stage } + New-Item -ItemType Directory -Force "$stage\RP412" | Out-Null + Copy-Item "$dist\*" "$stage\RP412" -Recurse -Force + Compress-Archive -Path "$stage\RP412" -DestinationPath $zipPath -Force + Remove-Item -Recurse -Force $stage }