Fix #378: Windows 更新后启动弹出 Windows Script Host 错误:There is no script engine for file extens - #379
Open
Memtensor-AI wants to merge 2 commits into
Open
Fix #378: Windows 更新后启动弹出 Windows Script Host 错误:There is no script engine for file extens#379Memtensor-AI wants to merge 2 commits into
Memtensor-AI wants to merge 2 commits into
Conversation
…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.
Collaborator
Author
🤖 Open Code ReviewTarget: PR #379 ✅ OpenCodeReview: Review complete: 0 finding(s) across 3 selected item(s). Generated by cloud-assistant via Open Code Review. |
Collaborator
Author
🔧 Open Code Review requested Agent fixOpen Code Review found 6 issue(s). I have resumed the development Agent to fix them.
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.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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
.vbslauncher and spawned it viawscript.exeto 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.vbshandler), this pops up the WSH error dialog. The login‑at‑login item and Start‑menu shortcut also invokewscript.exe MemmyLauncher.vbsand would fail the same way.Fix (branch
bugfix/autodev-378-20260908054258383, commit1a7bb01):App/shell/desktop/src/main/windows-update-launcher.ts— rewritten to emit a self‑deleting.cmdbatch that invokes PowerShell with-EncodedCommand(UTF‑16 base64), preserving localized (Chinese) install paths while eliminating the VBScript dependency entirely.App/shell/desktop/src/main/main.ts— updated the update helper to name the launcherlaunch-win-update-<ts>.cmdand spawn it throughcmd.exe /D /Cinstead ofwscript.exe.App/shell/desktop/src/main/windows-launch-at-login.ts— added a memoized VBScript‑availability probe (cscript.exe //B //Nologo //T:5on 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.windows-update-launcher.test.ts,windows-launch-at-login.test.ts, and thepackaged-runtime-boundary.test.tsguard assertions to cover the new.cmd/PowerShell entry point and the WSH‑disabled fallback; on‑Windows smoke test now drivescmd.exeinstead ofcscript.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 missingapp-builder-libtemplate file in this CI env (nothing my patch touched).bugfix/autodev-378-202609080542583831a7bb01f182871e07b2241672d0d7b9c4e715aa3originNote: 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.
How Has This Been Tested?
Automated tests are pending.
Checklist
@bittergreen please review this PR.
Reviewer Checklist