From 25ce5357c193a3ef3a42498ee1cb55511a3aad4d Mon Sep 17 00:00:00 2001 From: Mubeenpothigara13 Date: Sun, 10 May 2026 16:07:30 +0530 Subject: [PATCH 1/2] CI: pre-create payload subdirs to fix Copy-Item failure The Windows Installer workflow was failing on every push since April with: "Container cannot be copied onto existing leaf item." at the 'Copy-Item "python-embed\*" -Destination "$payload\python"' step. PowerShell's Copy-Item creates the destination as a leaf when the source's first item is a file, then refuses subsequent directory copies into it. Fix: explicitly New-Item all payload subdirs (app, python, pgsql, scripts, tools) up-front so Copy-Item always lands inside an existing container. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/windows-installer.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows-installer.yml b/.github/workflows/windows-installer.yml index 97de1f9..3536410 100644 --- a/.github/workflows/windows-installer.yml +++ b/.github/workflows/windows-installer.yml @@ -103,6 +103,9 @@ jobs: run: | $payload = "packaging\payload" New-Item -ItemType Directory -Force -Path $payload | Out-Null + foreach ($d in @('app','python','pgsql','scripts','tools')) { + New-Item -ItemType Directory -Force -Path "$payload\$d" | Out-Null + } # Flutter app Copy-Item "app\build\windows\x64\runner\Release\*" -Destination "$payload\app" -Recurse -Force @@ -118,7 +121,6 @@ jobs: Copy-Item "pgsql-extract\pgsql\*" -Destination "$payload\pgsql" -Recurse -Force # NSSM (win64) - New-Item -ItemType Directory -Force -Path "$payload\tools" | Out-Null Copy-Item "nssm-extract\nssm-$env:NSSM_VERSION\win64\nssm.exe" -Destination "$payload\tools\nssm.exe" -Force # Helper scripts From 0744268491408e85139b4c14e719c5a26b3a8a03 Mon Sep 17 00:00:00 2001 From: Mubeenpothigara13 Date: Sun, 10 May 2026 16:16:45 +0530 Subject: [PATCH 2/2] CI: reset $LASTEXITCODE after robocopy so step doesn't fail robocopy returns 0-7 on success (1 = files copied) but pwsh treats any non-zero $LASTEXITCODE at script end as a step failure. Reset it after the >=8 validation so the Assemble step exits clean. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/windows-installer.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows-installer.yml b/.github/workflows/windows-installer.yml index 3536410..29b4b55 100644 --- a/.github/workflows/windows-installer.yml +++ b/.github/workflows/windows-installer.yml @@ -113,6 +113,7 @@ jobs: # Backend source (exclude __pycache__, venv, .env) robocopy backend "$payload\backend" /E /XD __pycache__ venv .venv /XF .env | Out-Null if ($LASTEXITCODE -ge 8) { throw "robocopy backend failed: $LASTEXITCODE" } + $global:LASTEXITCODE = 0 # robocopy uses 0-7 for success; reset so the step doesn't appear failed # Embedded Python Copy-Item "python-embed\*" -Destination "$payload\python" -Recurse -Force