Skip to content

Fix release zips using backslashes in entry names (#492) - #502

Merged
MSchmoecker merged 2 commits into
Valheim-Modding:devfrom
bpavlina:fix-zip-separators
Oct 31, 2026
Merged

MSchmoecker merged 2 commits into
Valheim-Modding:devfrom
bpavlina:fix-zip-separators

Conversation

@bpavlina

Copy link
Copy Markdown
Contributor

Fixes #492.

The post-build step in JotunnLib.csproj runs powershell.exe, so publish.ps1 always runs under Windows PowerShell 5.1, whose Compress-Archive writes \ in zip entry names. The 2.30.1 and 2.30.2 Thunderstore packages have plugins\Jotunn.dll and don't extract properly on Linux and macOS. Same problem as #191, which f7fa6f1 fixed by switching to 7za; 0951d15 went back to Compress-Archive.

This replaces the two Compress-Archive calls with a small helper that zips through System.IO.Compression and writes /. If adding a file fails, the partial zip is deleted and the build fails. Before, Compress-Archive wrote the zip without that file and exited 0.

Tested on Windows PowerShell 5.1 and pwsh 7.4 on Linux: entries come out as plugins/Jotunn.dll and relative destination paths resolve correctly. On 5.1, a locked source file fails the build with no zip left behind. CI can't catch any of this since the post-build step only runs on Windows.

Compress-Archive in Windows PowerShell 5.1 (Microsoft.PowerShell.Archive
1.0.1.0) stores entries as plugins\Jotunn.dll. Since 7za.exe was replaced
in 0951d15, the 2.30.1 and 2.30.2 Thunderstore zips have backslash paths,
which unzip tools on Linux and macOS extract as flat files.
Moves the changelog line below the existing 2.30.3 entry.
@MSchmoecker

Copy link
Copy Markdown
Member

Thanks.

I will note that the failed extraction is specific to the zip software used and not a universal issue. I tested the current zip with multiple Linux devices and all of them extracted the zip just fine.

Still, using forward slashes is the of course more compatible.

@MSchmoecker
MSchmoecker merged commit 907dbb0 into Valheim-Modding:dev Oct 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PROBLEM] Failed to extract: appears to use backslashes as path separators

2 participants