You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(windows): make installer PowerShell-compatible - #2621
Fix Windows installer failures observed with the supported PowerShell installer on a Git/MSYS-enabled Windows environment.
Problems fixed
Avoid nested JavaScript quote loss when PowerShell invokes the Node native command for the Node >=22 check.
Use the native Windows System32\tar.exe instead of PATH-dependent Git/MSYS tar, which interprets C:\... paths incorrectly.
Write .memos-node-bin as UTF-8 without a BOM. Windows PowerShell Set-Content -Encoding UTF8 writes a BOM, causing the Hermes adapter to reject the recorded Node path and silently fall back to a potentially incompatible Node runtime.
Verification
PowerShell AST parse passed.
Node v25.2.1 version-check expression passed.
git diff --check passed.
The patched installer was executed successfully on Windows: package 2.0.21 downloaded, dependencies installed, existing config preserved, and the Memory Viewer started at http://127.0.0.1:18800/.
Scope
This changes only apps/memos-local-plugin/install.ps1; no runtime data or user configuration is modified.
Writing the marker as UTF-8 without a BOM fixes the Python consumers (bridge_client.py/daemon_manager.py call read_text(encoding="utf-8").strip(), which kept the BOM and made the path unusable), but it silently breaks the in-script consumer: line 846 reads this file with plain Get-Content under Windows PowerShell 5.1, where a BOM-less file is decoded using the ANSI code page. For non-ASCII node paths (e.g. nvm-windows under C:\Users\<non-ASCII user>\..., or a localized ProgramFiles), $NodeBin becomes mojibake, the -not $NodeBin fallback is not taken because the string is non-empty, and the daemon start at line 859/862 fails with a confusing "file not found" error. Please make the reader encoding-explicit when changing the writer.
$NodeMarkerPath = Join-Path $StagedPrefix ".memos-node-bin"
[IO.File]::WriteAllText($NodeMarkerPath, "$NodeForBridge`n", (New-Object System.Text.UTF8Encoding $false))
# NOTE: consumers must read this as UTF-8 explicitly (e.g.
# Get-Content -Encoding UTF8 / [IO.File]::ReadAllText) because it has no BOM.
Pinning extraction to %SystemRoot%\System32\tar.exe removes the previous PATH-based tar resolution, so hosts without the OS-bundled bsdtar (Windows 10 < 1803, Server 2016, and 32-bit shells where System32 is redirected to SysWOW64) now hard-fail with "Windows tar.exe not found" even when a usable tar is present. Also, if $env:SystemRoot is empty in the current environment, Join-Path throws a parameter-binding error instead of the intended message. Consider validating $env:SystemRoot first and keeping a constrained fallback to Get-Command tar.
💡 Suggested Change
Before:
$WindowsTar = Join-Path $env:SystemRoot "System32\tar.exe"
if (-not (Test-Path $WindowsTar)) { throw "Windows tar.exe not found" }
After:
if (-not $env:SystemRoot) { throw "Windows tar.exe not found: SystemRoot is not set" }
$WindowsTar = Join-Path $env:SystemRoot "System32\tar.exe"
if (-not (Test-Path $WindowsTar)) {
$WindowsTar = (Get-Command "tar" -CommandType Application -ErrorAction SilentlyContinue | Select-Object -First 1).Source
}
if (-not $WindowsTar) { throw "Windows tar.exe not found" }
Generated by cloud-assistant via Open Code Review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
area:pluginOpenClaw & Hermesstatus:readyReady for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix Windows installer failures observed with the supported PowerShell installer on a Git/MSYS-enabled Windows environment.
Problems fixed
System32\tar.exeinstead of PATH-dependent Git/MSYStar, which interpretsC:\...paths incorrectly..memos-node-binas UTF-8 without a BOM. Windows PowerShellSet-Content -Encoding UTF8writes a BOM, causing the Hermes adapter to reject the recorded Node path and silently fall back to a potentially incompatible Node runtime.Verification
git diff --checkpassed.http://127.0.0.1:18800/.Scope
This changes only
apps/memos-local-plugin/install.ps1; no runtime data or user configuration is modified.