fix(package): zip paths use / so the translation files survive extraction

Compress-Archive on Windows PowerShell 5.1 wrote the entries as
Translations\English\items.json. The zip format only allows /, so on
Linux and Steam Deck each text file came out as one flat file with
backslashes in its name, Jotunn found no Translations folder and every
mod text showed as [key]. The zips are now built by scripts/package.ps1.
This commit is contained in:
kanym 2026-09-29 02:07:55 +02:00
commit 6b020fb80a
2 changed files with 61 additions and 11 deletions

View file

@ -153,18 +153,10 @@
<PackageOutputDir>$(REPO_ROOT)dist\</PackageOutputDir>
</PropertyGroup>
<MakeDir Directories="$(PackageOutputDir)" Condition="!Exists('$(PackageOutputDir)')" />
<!-- Nexus users unzip straight into plugins, so the texts travel inside a RacesOfValheim
folder there; Thunderstore already gives every package a folder of its own. -->
<PropertyGroup>
<NexusStaging>$(IntermediateOutputPath)nexus\</NexusStaging>
</PropertyGroup>
<RemoveDir Directories="$(NexusStaging)" />
<Copy SourceFiles="@(TranslationFile)" DestinationFiles="@(TranslationFile->'$(NexusStaging)RacesOfValheim\Translations\%(RecursiveDir)%(Filename)%(Extension)')" />
<Message Text="Packaging Thunderstore and Nexus zips into $(PackageOutputDir)" Importance="high" />
<!-- The version is read back out of manifest.json rather than duplicated here, so
manifest.json stays the single place a release is numbered. Written with string
concatenation because MSBuild would eat a PowerShell $(...) subexpression. -->
<Exec Command="powershell -NoProfile -Command &quot;$v = (Get-Content '$(ProjectDir)..\manifest.json' -Raw | ConvertFrom-Json).version_number; Compress-Archive -Path '$(TargetDir)$(TargetName).dll', '$(ProjectDir)..\manifest.json', '$(ProjectDir)..\README.md', '$(ProjectDir)Package\icon.png', '$(ProjectDir)Translations' -DestinationPath ('$(PackageOutputDir)RacesOfValheim_Thunderstore_' + $v + '.zip') -Force; Compress-Archive -Path '$(TargetDir)$(TargetName).dll', '$(NexusStaging)RacesOfValheim' -DestinationPath ('$(PackageOutputDir)RacesOfValheim_Nexus_' + $v + '.zip') -Force&quot;" />
<!-- A script rather than Compress-Archive, which writes zip paths with backslashes: see
scripts\package.ps1. -->
<Exec Command="powershell -NoProfile -ExecutionPolicy Bypass -File &quot;$(ProjectDir)..\scripts\package.ps1&quot; -Dll &quot;$(TargetDir)$(TargetName).dll&quot; -Manifest &quot;$(ProjectDir)..\manifest.json&quot; -Readme &quot;$(ProjectDir)..\README.md&quot; -Icon &quot;$(ProjectDir)Package\icon.png&quot; -Translations &quot;$(ProjectDir)Translations&quot; -OutDir &quot;$(REPO_ROOT)dist&quot;" />
</Target>