diff --git a/pack-dist.ps1 b/pack-dist.ps1 index 15210dd..cbac0fe 100644 --- a/pack-dist.ps1 +++ b/pack-dist.ps1 @@ -27,6 +27,13 @@ if (-not (Test-Path $exe)) { throw "Release\rpl4opt.exe not found - build first (see BUILD.md 2)." } +# Refuse to touch a dist the game is currently running from. +$running = Get-Process rpl4opt -ErrorAction SilentlyContinue | + Where-Object { $_.Path -like "$dist\*" } +if ($running) { + throw "rpl4opt.exe is running from $dist (PID $($running.Id)) - close the game first." +} + Write-Host "Packing into $dist" if (Test-Path $dist) { Remove-Item -Recurse -Force $dist } New-Item -ItemType Directory -Force "$dist\SPOOLS" | Out-Null