How to Build openclaw-windows-node from Source
Run .\build.ps1 in PowerShell 7 after installing the .NET 7 SDK (pinned in global.json) to compile the solution and execute the mandatory validation test suite.
Building openclaw-windows-node from source requires a Windows environment with modern .NET tooling. This repository contains C# projects, PowerShell automation scripts, and optional frontend assets that compile into the OpenClaw Windows client node. The master build script enforces the validation workflow defined in AGENTS.md to ensure code quality before producing binaries.
Prerequisites
Before compiling, ensure your development environment meets these requirements:
- Windows 10 or later — The node targets Windows-specific APIs and WinUI 3.
- PowerShell 7+ — The
build.ps1script uses modern language features not available in Windows PowerShell 5.1. Install viawinget install Microsoft.PowerShell. - .NET SDK 7.0 — The repository pins the exact SDK version in
global.jsonto prevent "SDK not found" errors. Install the matching version withwinget install Microsoft.DotNet.SDK.7. - Git — Required to clone the repository and manage submodules.
- Inno Setup (optional) — Only needed if generating the self-extracting installer via
installer.isslocated at the repository root. - Node.js 18+ (optional) — Required for running
npm cito restore frontend assets referenced by the build pipeline.
Tip: Verify your installed .NET version matches
global.jsonexactly. Mismatches cause the build to halt immediately.
Step-by-Step Build Instructions
1. Clone the Repository
git clone https://github.com/openclaw/openclaw-windows-node.git
cd openclaw-windows-node
2. Run the Master Build Script
Execute the orchestration script from the repository root:
.\build.ps1
This script performs three critical actions defined in AGENTS.md:
-
Restore and Build — Calls
dotnet restorefollowed bydotnet buildonopenclaw-windows-node.slnx, compiling all C# projects includingOpenClaw.Tray.WinUIandOpenClaw.SetupEngine. -
Shared Library Tests — Executes
dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore. -
Tray Application Tests — Executes
dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore.
If any validation step fails, the script aborts with diagnostic output. Successful completion produces binaries under each project's bin/Release/net7.0-windows/ directory.
3. Package the Installer (Optional)
To generate a distributable .exe installer using the Inno Setup script:
.\scripts\build-inno-local.ps1
This invokes iscc against installer.iss, bundling the compiled output and any frontend assets built via npm.
4. Launch the Local Build
Verify the build by launching the tray application:
.\run-app-local.ps1
This helper script starts the WinUI 3 tray node directly from the build output without requiring installation.
Troubleshooting Common Build Failures
dotnet command not found or SDK version errors
The build requires the exact .NET SDK version specified in global.json. Install the specific version listed in that file to resolve "SDK not found" exceptions.
Build fails with MSB4018 (WinUI related) Missing Windows SDK components for WinUI 3. Install the Desktop Development with C++ workload through the Visual Studio Installer to provide required native tooling.
Tests report "No tests were run" on first execution
The test commands in build.ps1 use the --no-restore flag. On a clean clone, test binaries do not exist yet. Run dotnet build on the test projects first, or temporarily omit --no-restore for the initial run.
Inno Setup script cannot locate resources
The frontend build steps require Node.js dependencies. Run npm ci in the repository root to populate node_modules before executing build-inno-local.ps1.
Summary
- Install PowerShell 7 and the .NET SDK version pinned in
global.json. - Clone the
openclaw/openclaw-windows-noderepository. - Execute
.\build.ps1to restore packages, compileopenclaw-windows-node.slnx, and run the AGENTS.md validation workflow. - Optional: Generate installers with
.\scripts\build-inno-local.ps1or launch locally with.\run-app-local.ps1.
Frequently Asked Questions
What version of the .NET SDK is required?
According to the global.json file in the repository root, the build pins a specific .NET 7 SDK version. Installing the latest .NET 7 SDK usually satisfies this requirement, but the exact patch version listed in global.json prevents "SDK not found" errors during dotnet build.
Can I build openclaw-windows-node without using PowerShell?
While you can manually invoke dotnet build on openclaw-windows-node.slnx and run dotnet test on the individual test projects, you bypass the validation workflow defined in AGENTS.md. The build.ps1 script enforces this sequence, so manual builds are supported for development but not recommended for release verification.
Why do tests fail with "No test assets found" on the first run?
The build.ps1 script passes --no-restore to dotnet test for performance. On a fresh clone, the test projects have not been built yet, so the test runner finds no binaries. Either build the test projects once with dotnet build beforehand, or run the tests without --no-restore for the first execution.
Where are the compiled binaries located after running build.ps1?
Successful builds place output in each project's bin/Release/net7.0-windows/ folder. For example, the main tray UI executable resides at src/OpenClaw.Tray.WinUI/bin/Release/net7.0-windows/OpenClaw.Tray.WinUI.exe.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →