Repository navigation
Description
What happened?
The Windows standalone layout uses Known Folders only. HOME / USERPROFILE / LOCALAPPDATA are ignored. Non-Windows honours HOME / XDG_*. HIROUTE_RUNTIME_DIR is honoured by the CLI and by nothing on the daemon side, so a second instance needs two hand-matched overrides with no check that they agree.
StandaloneLayout::from_environment() on Windows calls SHGetKnownFolderPath and returns. Pointing HOME/USERPROFILE at a temp directory silently does nothing, while the same struct honours four variables on macOS and Linux.
A development daemon started with --role all --standalone --dev-standalone --console-assets <dist> therefore resolves the same %LOCALAPPDATA%\HiRoute\cli state root, the same control endpoint (<runtime_root>\hiroute\control.sock) and the same Gateway listener as the installed service. The second process aborts with hiroute.daemon-startup-failure/v1 / invalid_configuration / GATEWAY_LISTENER_ADDRESS_UNAVAILABLE. If the official service is stopped instead, the dev daemon writes diagnostics and journal into the real user tree.
hirouted has --storage-root / --runtime-root. The CLI has HIROUTE_RUNTIME_DIR first in resolve_runtime_root. No code under crates/daemon reads HIROUTE_RUNTIME_DIR, and the CLI does not read the daemon flags. A mismatch shows up as generic "daemon unavailable", not as "CLI runtime dir X vs running daemon Y".
Reproduction
- On Windows, leave the installed Task-managed daemon running.
- Export
HOME/USERPROFILEto a temp directory and start a secondhirouted --role all --standalone. - Confirm it still binds the installed state root / listener and aborts with
GATEWAY_LISTENER_ADDRESS_UNAVAILABLE. - Set
HIROUTE_RUNTIME_DIRfor the CLI only, or--runtime-rootfor the daemon only, and confirm the pair is not checked.
Do not attach the user LocalAppData tree.
Code evidence
Citations match comparison d9fe4c04ae2cd54fdb2850687a9567c9104f6660.
- Windows Known Folder layout:
crates/host-runtime/src/standalone.rs(from_environment). - Profile/LocalAppData:
crates/platform/src/windows/background.rs. - CLI-only
HIROUTE_RUNTIME_DIR:crates/cli/src/client.rs. - Daemon
--storage-root/--runtime-root:crates/daemon/src/control/bin.rs.
This matches the shared-client-access Windows headless rule: Known Folders own installed-instance paths; HOME/XDG cannot redirect them. The gap is a supported scratch-instance override for development, which Unix already has via HOME/XDG_*.
HiRoute version or commit
Windows x64. Code citations match comparison d9fe4c04ae2cd54fdb2850687a9567c9104f6660.
Operating system and architecture
Windows x64.
Expected result
Honour an explicit override on Windows that both CLI and daemon accept and verify (HIROUTE_HOME, LOCALAPPDATA, or a shared --root). Document a supported scratch-instance recipe. Name the collided resource (listener port vs control socket vs store lock) instead of one generic invalid_configuration.
Data check
No credentials, account names or LocalAppData dumps are included. Error codes and well-known install locations are sanitized observable results.
Activity
[-][Bug] Windows install layout ignores HOME/USERPROFILE; HIROUTE_RUNTIME_DIR is CLI-only[/-][+][Feature request] Support isolated development instances on Windows[/+]johnlanni commentedon Nov 5, 2026
Thanks for the report. Installed Windows instances intentionally use the account's Known Folders, so changing
HOMEorUSERPROFILEis not a supported way to isolate another instance. We are classifying a supported Windows scratch-instance workflow as a feature request.For isolated development and testing of shared functionality, we recommend building and running the Linux version inside WSL2. Keep the checkout and test data in the WSL Linux filesystem, use separate Linux home/data/runtime directories, and choose listener ports that do not conflict with the installed Windows service. Running the Windows
.exefrom WSL still uses Windows account paths and does not provide this isolation.This approach is suitable for shared Gateway, routing, protocol and Web Console development. Windows-native functionality—including NSIS installation/uninstallation, scheduled Tasks, ACLs, named pipes and native Agent integration—should be verified separately on Windows, preferably with a dedicated test account or VM.
We will keep this issue open with
help wantedfor contributions toward a supported Windows-native isolated development workflow.