Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Version numbers follow `MAJOR.MINOR.PATCH`; the 0.x series is under active development. Release tags and downloadable archives use the same version.

## 0.12.2 — 2026-11-11

- Starting several zStudio instances together no longer fails when WPF libraries are first extracted.

## 0.12.1 — 2026-11-11

- MW3 source maps list a mission's valves in the World tree, one per name, each with what it does. A valve's card shows what sets it, its reactions and what waits on it, with links to the vehicles, route nodes and valves involved, and edits its starting value, computed inputs and reactions with pickers; rename, delete and new valves are single undoable changes that keep the files' comments and layout.
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
<Description>Advanced viewer and editor for Zipper Interactive's ZBD files</Description>
<RepositoryUrl>https://github.com/Vorta/zStudio</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>0.12.1</Version>
<Version>0.12.2</Version>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

zStudio is a Windows desktop application. It unpacks RECOIL's retail game files once into an editable source project (the developers' original `data\` and `gamegen\` tree: text resources, glTF models, PNG textures, WAV sounds and build scripts), lets you edit the maps in zStudio or in Blender, and exports new game files from the sources. AI agents can work in the same workspace through local MCP.

Download **[zStudio v0.12.1](https://github.com/Vorta/zStudio/releases/tag/v0.12.1)** for Windows x64.
Download **[zStudio v0.12.2](https://github.com/Vorta/zStudio/releases/tag/v0.12.2)** for Windows x64.

zStudio tells you when a newer release is out: **Update available** appears in the status bar; click it for the release page. zStudio asks GitHub's public release API at most once a day and sends nothing but its version; **Help → Check for updates** asks now, and **Help → Check for updates automatically** turns the daily check off. Running zStudio 0.9.6 or older on the same Windows account turns the daily check back on, because older versions drop settings they don't know.

Expand Down
2 changes: 1 addition & 1 deletion blender/zstudio_recoil/blender_manifest.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
schema_version = "1.0.0"
id = "zstudio_recoil"
version = "0.12.1"
version = "0.12.2"
name = "zStudio RECOIL"
tagline = "Edit RECOIL glTF models, linked worlds, flags and zones"
maintainer = "Vorta"
Expand Down
2 changes: 1 addition & 1 deletion docs/agents/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

- Owner decision (0.9.7): zStudio ships as one self-contained, compressed `zStudio.exe` with only the necessary files beside it. The ZIP root holds exactly `zStudio.exe`, `LICENSE`, `THIRD-PARTY-NOTICES.md` and the Blender extension `zStudio-Blender-extension-<version>.zip` (the extension id inside stays `zstudio_recoil`); README, CHANGELOG, CONTRIBUTING, SECURITY and the user guides are not shipped (**Help** opens the guides online at the installed version's tag). Unsigned.
- `zStudio.exe` is the .NET single-file bundle of `zStudio.Desktop`: `./tools/publish.ps1` publishes it with `-p:StudioPackage=true` (Desktop project: self-contained, single file, native libraries inside, compressed, per-assembly ReadyToRun because the SDK's composite default is larger and starts slower, the single-file analyzer off because its implicit ILLink package breaks locked restores; `Directory.Build.props`: embedded symbols) and renames it from `zStudio.Desktop.exe` (the bundle keeps its assembly name). It deletes the Desktop ReadyToRun intermediates first, so images of an earlier configuration (composite stubs) are never bundled. The icon is the checked-in `src/zStudio.Desktop/Assets/studio.ico` (the owner's artwork).
- WPF's two mixed-mode (C++/CLI) assemblies of .NET 11, `DirectWriteForwarder.dll` and `System.Printing.dll`, cannot load from a bundle and need `ijwhost.dll` beside them on disk: the package embeds them in `zStudio.Desktop.dll` instead of bundling them (`EmbedMixedModeAssemblies`, `ExcludeMixedModeAssemblies`), and `MixedModeAssemblies` (a module initializer, before WPF's first type) writes them beside the extracted `ijwhost.dll` when WPF first asks and loads them from there; `verify-package.ps1` refuses a bundle that holds them. At run time only six native libraries (WPF's five and the C++/CLI host `ijwhost.dll`) and those two assemblies (about 9 MB together) extract, once per build, to `%TEMP%\.net\zStudio\<bundle id>`; the managed assemblies load from the bundle and `AppContext.BaseDirectory` is the folder of `zStudio.exe`, where the app finds `zStudio-Blender-extension-<version>.zip` (Edit in Blender's install offer, `source_blender_extension`). The installed extension checks its helper by version: `--blender-helper` `info` reports zStudio's version, which must equal the extension's.
- WPF's two mixed-mode (C++/CLI) assemblies of .NET 11, `DirectWriteForwarder.dll` and `System.Printing.dll`, cannot load from a bundle and need `ijwhost.dll` beside them on disk: the package embeds them in `zStudio.Desktop.dll` instead of bundling them (`EmbedMixedModeAssemblies`, `ExcludeMixedModeAssemblies`), and `MixedModeAssemblies` (a module initializer, before WPF's first type) writes them beside the extracted `ijwhost.dll` when WPF first asks and loads them from there (if another process publishes and loads the same cached assembly first, the writer verifies its complete content before accepting that winner); `verify-package.ps1` refuses a bundle that holds them. At run time only six native libraries (WPF's five and the C++/CLI host `ijwhost.dll`) and those two assemblies (about 9 MB together) extract, once per build, to `%TEMP%\.net\zStudio\<bundle id>`; the managed assemblies load from the bundle and `AppContext.BaseDirectory` is the folder of `zStudio.exe`, where the app finds `zStudio-Blender-extension-<version>.zip` (Edit in Blender's install offer, `source_blender_extension`). The installed extension checks its helper by version: `--blender-helper` `info` reports zStudio's version, which must equal the extension's.
- `THIRD-PARTY-NOTICES.md` holds every licence text (packages with identical texts share one section) and the .NET runtime's licence and notices; a dependency update changes its row and, when its terms change, its section.
- Publishing stages both the package folder and ZIP below `artifacts/` and runs `tools/verify-package.ps1` on that staged pair before replacing `artifacts/zStudio-win-x64/` and `artifacts/zStudio-<version>-win-x64.zip`. A rejected package leaves the previous pair intact. Installation keeps backups of both until the new pair is installed; an installation failure restores the previous folder and ZIP, and a failed restoration reports the retained backup paths for recovery. Only a successful installation removes the superseded folder and older ZIPs. A custom `-Output` must also be below `artifacts/`; publication paths must not use directory links. Verification checks: the root inventory; the bundle (a format-6 bundle header, not extract-all, compressed, with `zStudio.Desktop.dll`, its `deps.json` and `runtimeconfig.json` and exactly the five WPF native libraries; no composite ReadyToRun image, symbol files, `.zbd`, `.zrd`, `.bndb`, `.pfx`, `.p12` or `.key`); the notices (every package in the bundled `deps.json` has a row of the same version, every row a shipped package, every row's link a heading of the file); the file and product version of `zStudio.exe`; `LICENSE` and the notices against the checkout; the Blender extension's version and file hashes against its sources; SHA-256 parity of every ZIP entry.
- Manual distribution check: extract into a folder with spaces, start `zStudio.exe` from an unrelated working directory with a dataset path containing spaces and installed-runtime discovery disabled; only the six native libraries and the two mixed-mode assemblies appear under `%TEMP%\.net\zStudio`; the six RT_ICON resources match the six ICO frames.
Expand Down
33 changes: 30 additions & 3 deletions src/zStudio.Desktop/MixedModeAssemblies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,37 @@ internal static void Install()
/// <summary>Writes the assembly unless the folder already holds exactly it (another zStudio of this build may have it loaded).</summary>
private static void Write(string path, byte[] bytes)
{
try { if (File.Exists(path) && File.ReadAllBytes(path).AsSpan().SequenceEqual(bytes)) return; }
catch (IOException) { }
if (Matches(path, bytes)) return;
string temporary = path + "." + Guid.NewGuid().ToString("N") + ".tmp";
try { File.WriteAllBytes(temporary, bytes); File.Move(temporary, path, overwrite: true); }
try { File.WriteAllBytes(temporary, bytes); Publish(temporary, path, bytes); }
finally { try { File.Delete(temporary); } catch (IOException) { } }
}

// Another process can publish and load this same assembly after our initial check.
// Windows then refuses replacement; accept that winner only after verifying its bytes.
internal static void Publish(string temporary, string path, byte[] bytes)
{
try { File.Move(temporary, path, overwrite: true); }
catch (IOException) when (Matches(path, bytes)) { }
catch (UnauthorizedAccessException) when (Matches(path, bytes)) { }
}

private static bool Matches(string path, byte[] bytes)
{
try
{
using FileStream file = new(path, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete);
if (file.Length != bytes.Length) return false;
Span<byte> chunk = stackalloc byte[4096];
for (int offset = 0; offset < bytes.Length; offset += chunk.Length)
{
int count = Math.Min(chunk.Length, bytes.Length - offset);
file.ReadExactly(chunk[..count]);
if (!chunk[..count].SequenceEqual(bytes.AsSpan(offset, count))) return false;
}
return file.ReadByte() == -1;
}
catch (IOException) { return false; }
catch (UnauthorizedAccessException) { return false; }
}
}
4 changes: 2 additions & 2 deletions src/zStudio.Desktop/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"type": "Project",
"dependencies": {
"ModelContextProtocol.Core": "[2.4.0, )",
"zStudio.Application": "[0.12.1, )"
"zStudio.Application": "[0.12.2, )"
}
},
"zstudio.rendering": {
Expand All @@ -87,7 +87,7 @@
"Vortice.DXGI": "[3.8.3, )",
"Vortice.Direct3D11": "[3.8.3, )",
"Vortice.Direct3D9": "[3.8.3, )",
"zStudio.Core": "[0.12.1, )"
"zStudio.Core": "[0.12.2, )"
}
},
"Clipper2": {
Expand Down
35 changes: 35 additions & 0 deletions tests/zStudio.Desktop.Tests/MixedModeCacheTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.IO;
using Xunit;

namespace zStudio.Desktop.Tests;

public sealed class MixedModeCacheTests
{
[Fact]
public void LoadedConcurrentWinnerIsAcceptedOnlyWhenItsBytesMatch()
{
// A competing cold start can load its published DLL before our writer moves its copy.
string root = Path.Combine(Path.GetTempPath(), "zstudio-mixed-cache-" + Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(root);
try
{
byte[] expected = [1, 2, 3, 4];
string target = Path.Combine(root, "cached.dll"), temporary = Path.Combine(root, "pending.tmp");
File.WriteAllBytes(target, expected); File.WriteAllBytes(temporary, expected);
using (var loaded = new FileStream(target, FileMode.Open, FileAccess.Read, FileShare.Read))
{
MixedModeAssemblies.Publish(temporary, target, expected);
Assert.Equal(expected, File.ReadAllBytes(target));
Assert.True(File.Exists(temporary));
}
File.WriteAllBytes(target, [9, 8, 7, 6]);
using (var loaded = new FileStream(target, FileMode.Open, FileAccess.Read, FileShare.Read))
{
var error = Record.Exception(() => MixedModeAssemblies.Publish(temporary, target, expected));
Assert.True(error is IOException or UnauthorizedAccessException);
Assert.Equal(new byte[] { 9, 8, 7, 6 }, File.ReadAllBytes(target));
}
}
finally { Directory.Delete(root, recursive: true); }
}
}
10 changes: 5 additions & 5 deletions tests/zStudio.Desktop.Tests/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,16 +216,16 @@
"CommunityToolkit.Mvvm": "[8.4.2, )",
"NAudio.Core": "[3.3.0, )",
"NAudio.Wasapi": "[3.3.0, )",
"zStudio.Core": "[0.12.1, )",
"zStudio.Mcp": "[0.12.1, )",
"zStudio.Rendering": "[0.12.1, )"
"zStudio.Core": "[0.12.2, )",
"zStudio.Mcp": "[0.12.2, )",
"zStudio.Rendering": "[0.12.2, )"
}
},
"zstudio.mcp": {
"type": "Project",
"dependencies": {
"ModelContextProtocol.Core": "[2.4.0, )",
"zStudio.Application": "[0.12.1, )"
"zStudio.Application": "[0.12.2, )"
}
},
"zstudio.rendering": {
Expand All @@ -235,7 +235,7 @@
"Vortice.DXGI": "[3.8.3, )",
"Vortice.Direct3D11": "[3.8.3, )",
"Vortice.Direct3D9": "[3.8.3, )",
"zStudio.Core": "[0.12.1, )"
"zStudio.Core": "[0.12.2, )"
}
},
"Clipper2": {
Expand Down
10 changes: 5 additions & 5 deletions tools/zStudio.PreviewCheck/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@
"CommunityToolkit.Mvvm": "[8.4.2, )",
"NAudio.Core": "[3.3.0, )",
"NAudio.Wasapi": "[3.3.0, )",
"zStudio.Core": "[0.12.1, )",
"zStudio.Mcp": "[0.12.1, )",
"zStudio.Rendering": "[0.12.1, )"
"zStudio.Core": "[0.12.2, )",
"zStudio.Mcp": "[0.12.2, )",
"zStudio.Rendering": "[0.12.2, )"
}
},
"zstudio.mcp": {
"type": "Project",
"dependencies": {
"ModelContextProtocol.Core": "[2.4.0, )",
"zStudio.Application": "[0.12.1, )"
"zStudio.Application": "[0.12.2, )"
}
},
"zstudio.rendering": {
Expand All @@ -74,7 +74,7 @@
"Vortice.DXGI": "[3.8.3, )",
"Vortice.Direct3D11": "[3.8.3, )",
"Vortice.Direct3D9": "[3.8.3, )",
"zStudio.Core": "[0.12.1, )"
"zStudio.Core": "[0.12.2, )"
}
},
"Clipper2": {
Expand Down