Skip to content

Fix #378: Windows 更新后启动弹出 Windows Script Host 错误:There is no script engine for file extens - #379

Open
Memtensor-AI wants to merge 2 commits into
mainfrom
bugfix/autodev-378-20260908054258383
Open

Fix #378: Windows 更新后启动弹出 Windows Script Host 错误:There is no script engine for file extens#379
Memtensor-AI wants to merge 2 commits into
mainfrom
bugfix/autodev-378-20260908054258383

Conversation

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

Description

The task submission tool is not available in this session. I've completed the fix work and pushed the branch. Here is the summary:

Summary

Issue #378 — Windows Script Host error There is no script engine for file extension '.vbs' on Memmy launch after an update.

Root cause: Memmy's Windows update helper wrote a temporary .vbs launcher and spawned it via wscript.exe to relaunch the app after the installer completed. On systems where the VBScript engine has been disabled (Windows Feature removed, GPO block, or a Windows update that unregistered the .vbs handler), this pops up the WSH error dialog. The login‑at‑login item and Start‑menu shortcut also invoke wscript.exe MemmyLauncher.vbs and would fail the same way.

Fix (branch bugfix/autodev-378-20260908054258383, commit 1a7bb01):

  1. App/shell/desktop/src/main/windows-update-launcher.ts — rewritten to emit a self‑deleting .cmd batch that invokes PowerShell with -EncodedCommand (UTF‑16 base64), preserving localized (Chinese) install paths while eliminating the VBScript dependency entirely.
  2. App/shell/desktop/src/main/main.ts — updated the update helper to name the launcher launch-win-update-<ts>.cmd and spawn it through cmd.exe /D /C instead of wscript.exe.
  3. App/shell/desktop/src/main/windows-launch-at-login.ts — added a memoized VBScript‑availability probe (cscript.exe //B //Nologo //T:5 on a temp no‑op script). When VBScript is unavailable the login item falls back to the packaged executable so the user's next sign‑in is silent.
  4. Tests — updated windows-update-launcher.test.ts, windows-launch-at-login.test.ts, and the packaged-runtime-boundary.test.ts guard assertions to cover the new .cmd/PowerShell entry point and the WSH‑disabled fallback; on‑Windows smoke test now drives cmd.exe instead of cscript.

Tests: vitest run tests/windows-update-launcher.test.ts tests/windows-launch-at-login.test.ts → 10 passed, 1 skipped (Windows‑only). packaged-runtime-boundary.test.ts → 67 pass; 2 pre‑existing unrelated failures caused by missing app-builder-lib template file in this CI env (nothing my patch touched).

  • Branch: bugfix/autodev-378-20260908054258383
  • Commit: 1a7bb01f182871e07b2241672d0d7b9c4e715aa3
  • Push status: pushed to origin
  • Reviewer: @bittergreen

Note: I was unable to call mcp__task__submit_result — the tool is not exposed in this session's toolset — so this text is the completion report. Scheduler can create the PR from the branch above.

Related Issue (Required): Fixes #378

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g. code style improvements, linting)
  • Documentation update

How Has This Been Tested?

Automated tests are pending.

  • Unit Test
  • Test Script Or Test Steps (please provide)
  • Pipeline Automated API Test (please provide)

Checklist

  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have created related documentation issue/PR in MemOS-Docs (if applicable)
  • I have linked the issue to this PR (if applicable)
  • I have mentioned the person who will review this PR

@bittergreen please review this PR.

Reviewer Checklist

…item

The post-update helper wrote and spawned a .vbs launcher through wscript.exe,
and the Start-menu / login-at-login proxy also called wscript.exe against
MemmyLauncher.vbs. On systems where the VBScript engine has been disabled
(Windows Feature removed, GPO block, or a Windows update that unregistered
the .vbs handler), the first post-update launch surfaced "There is no script
engine for file extension '.vbs'" (issue #378).

* Replace the ephemeral update launcher with a self-deleting .cmd batch that
  dispatches to PowerShell via -EncodedCommand, so localized paths still
  round-trip through UTF-16 without needing Windows Script Host.
* Detect VBScript availability at runtime and fall back to launching the
  packaged executable directly for the Windows login item when the .vbs
  engine cannot execute; the memoized probe uses cscript //B on a temporary
  no-op script.
* Update the guard tests and Chinese-path launcher smoke test to cover the
  new .cmd entry point and the VBScript-disabled fallback path.
@Memtensor-AI

Memtensor-AI commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator Author

🤖 Open Code Review

Target: PR #379
Task: d5e57cb373f0445a
Base: main
Head: bugfix/autodev-378-20260908054258383
Head SHA: db85c4201bb012764746808bc7ef83f9612ab287

OpenCodeReview: Review complete: 0 finding(s) across 3 selected item(s).

Generated by cloud-assistant via Open Code Review.

@Memtensor-AI

Copy link
Copy Markdown
Collaborator Author

🔧 Open Code Review requested Agent fix

Open Code Review found 6 issue(s). I have resumed the development Agent to fix them.

  • Task: d5e57cb373f0445a
  • Fix attempt: 1/2
  • Finding delta: 0 repeated / 6 new / 0 likely resolved

The Agent will push a new commit to this PR branch. OCR will recheck after the commit is pushed.

* Wrap the PowerShell -ArgumentList payload in @(...) so Start-Process
  always receives an explicit array literal and unpacks each argument as
  a separate token instead of one concatenated string.
* Probe with wscript.exe instead of cscript.exe so the availability check
  mirrors the exact executable used by the production login item, avoiding
  false positives where cscript succeeds via // switches but wscript still
  errors under a broken .vbs association.
* Guard the probe result on both status === 0 and error == null so a
  signal-killed process (e.g. the timeout firing) is treated as failure
  explicitly rather than through null coercion; the timeout is now a
  named constant with a rationale comment.
* Use windowsPath.join for probeScript so the string handed to wscript
  stays consistent with the rest of the file's Windows-targeted paths.
* Resolve cmd.exe through %SystemRoot% (a kernel-set variable) rather
  than %ComSpec%, matching the same trust chain the generated CMD batch
  uses for powershell.exe.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows 更新后启动弹出 Windows Script Host 错误:There is no script engine for file extension '.vbs'

2 participants