Skip to content

fix(windows): install a self-contained runtime - #58

Merged
Fei-Away merged 1 commit into
Fei-Away:mainfrom
rwang23:fix/windows-self-contained-engine
Jul 17, 2026
Merged

fix(windows): install a self-contained runtime#58
Fei-Away merged 1 commit into
Fei-Away:mainfrom
rwang23:fix/windows-self-contained-engine

Conversation

@rwang23

@rwang23 rwang23 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

中文

摘要

  • 安装器把运行所需的 assets/scripts/ 复制到 %LOCALAPPDATA%\CodexDreamSkin\engine
  • 启动、恢复和托盘快捷方式的脚本路径与工作目录统一指向受管 engine,原始仓库克隆不再是运行时依赖。
  • engine 更新使用 staging、文件数量与 SHA-256 校验、同卷目录替换和失败回滚,并拒绝 reparse point。
  • 重装前检查旧托盘进程,避免新旧脚本混用。
  • 同步更新平台文档、Windows changelog 和 Windows skill 说明。

Closes #56

类型

  • 缺陷修复
  • 文档
  • 脚本、安装或恢复

平台

  • Windows

自测

  • powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\windows\tests\run-tests.ps1 -EngineOnly
    • 从包含空格和中文的临时源码路径安装 engine。
    • 核对源码和已安装文件的数量与 SHA-256。
    • 验证重装会删除残留文件并接收新增运行文件。
    • 验证不完整源码不会替换可用 engine,也不会留下正常事务残留。
    • 删除临时源码后,解析受管 engine 内全部 PowerShell 文件并确认三个入口仍然存在。
  • 解析 windows/ 下全部 PowerShell 文件,无语法错误。
  • node --check windows/scripts/injector.mjs
  • node --check windows/scripts/image-metadata.mjs
  • node --check windows/assets/renderer-inject.js
  • git diff --check
  • 下方记录了系统版本和 Codex 来源。
  • 已更新 windows/CHANGELOG.md

安全

  • 不修改 Codex 官方安装目录、asar 或签名。
  • 不写入 API Base URL 或 Key。
  • 不改变 CDP 的回环绑定和端口策略。
  • 受管目录删除只允许发生在 Dream Skin 状态根目录内,并拒绝 reparse point。

补充


English

Summary

  • Copy the required assets/ and scripts/ into %LOCALAPPDATA%\CodexDreamSkin\engine during installation.
  • Point launch, restore, and tray shortcuts and their working directories at the managed engine, removing the source checkout as a runtime dependency.
  • Update the engine through staging, file-count and SHA-256 verification, same-volume directory replacement, and rollback while rejecting reparse points.
  • Check for an older tray process before reinstalling to avoid mixed source and managed scripts.
  • Update the platform documentation, Windows changelog, and Windows skill instructions.

Closes #56

Type

  • Bug fix
  • Documentation
  • Scripts, install, or restore

Platform

  • Windows

Self-check

  • powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\windows\tests\run-tests.ps1 -EngineOnly
    • Installs from a temporary source path containing spaces and Chinese characters.
    • Compares source and installed file counts and SHA-256 hashes.
    • Confirms that reinstall removes stale files and accepts a newly added runtime file.
    • Confirms that an incomplete source leaves the working engine unchanged and leaves no normal transaction artifacts.
    • Removes the temporary source, parses every installed PowerShell file, and confirms that all three entry points remain present.
  • Parsed every PowerShell file under windows/ with no syntax errors.
  • node --check windows/scripts/injector.mjs
  • node --check windows/scripts/image-metadata.mjs
  • node --check windows/assets/renderer-inject.js
  • git diff --check
  • Environment and Codex source are recorded below.
  • Updated windows/CHANGELOG.md.

Security

  • Does not modify the official Codex installation, asar, or signatures.
  • Does not write an API Base URL or key.
  • Does not change the loopback CDP binding or port policy.
  • Runtime deletion stays inside the Dream Skin state root and rejects reparse points.

Notes

@Fei-Away
Fei-Away force-pushed the fix/windows-self-contained-engine branch from 105ba96 to 44cff85 Compare July 17, 2026 06:01
@Fei-Away

Copy link
Copy Markdown
Owner

Maintainer update: rebased the original contributor commit onto current main while preserving Renfei Wang as author. The conflict resolution retains all newer atomic config, nested TOML, Store AUMID, native stderr, UTF-8 BOM, and CI regressions.

I also made cleanup of an obsolete engine backup non-fatal after a new engine has already been committed, including a forced-cleanup regression under $WarningPreference = "Stop". Local PowerShell parsing, Windows JavaScript/JSON parsing, engine compatibility fixtures, and git diff --check pass. Waiting for the real Windows PowerShell 5.1 and PowerShell 7 Actions runs before review/merge.

@Fei-Away Fei-Away left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated on current main. The managed engine is staged inside the state root, rejects reparse points, verifies file count and SHA-256 before publication, rolls back a failed replacement, and keeps post-commit cleanup failures non-fatal. Shortcuts and working directories all bind to the managed copy, and the source-deletion regression proves the installed entry points remain usable. Static checks, Windows PowerShell 5.1, and PowerShell 7 are green.

@Fei-Away

Copy link
Copy Markdown
Owner

Final validation passed on the rebased head: Static checks ✅, Windows PowerShell 5.1 ✅, PowerShell 7 ✅. The original contributor author is preserved. Thank you @rwang23—this closes the most important remaining Windows installation gap.

@Fei-Away
Fei-Away merged commit 9ab7c09 into Fei-Away:main Jul 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows/Install] 快捷方式依赖源码目录 / Installed shortcuts depend on the source checkout

2 participants