Skip to content

Load on Windows 10: bootstrap the framework without Windows 11-only imports - #9

Merged
greenhat616 merged 1 commit into
mainfrom
fix/win10-framework-bootstrap
Oct 28, 2026
Merged

greenhat616 merged 1 commit into
mainfrom
fix/win10-framework-bootstrap

Conversation

@greenhat616

@greenhat616 greenhat616 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • On Windows 10 the executable stopped at load time (本工具似乎不支持在 Win 10 下运行 #7): reactor's framework bootstrap imported TryCreatePackageDependency and AddPackageDependency statically, and those exist only on Windows 11. That took down CLI mode and the runtime check too.
  • The fork now resolves these functions at run time. It uses them only from Windows 11 24H1 (kernelbase.dll exports TryCreatePackageDependency2), the same gate Windows App SDK's own bootstrapper uses.
  • On earlier builds it loads Microsoft.WindowsAppRuntime.Bootstrap.dll from the executable's directory and calls MddBootstrapInitialize2.
  • COM is now initialized before bootstrapping, because the bootstrapper reaches the runtime's lifetime manager (DDLM) through COM.
  • The README documents the Bootstrap.dll requirement before 24H1.
  • Publishing the bootstrapper with each release landed after this merge; see Publish the Windows App SDK bootstrapper with each release #10.

Fork change: libnyanpasu/windows-rs nyanpasu at d1574fd (one commit; to be added as patch 8 in #2).

This makes CLI mode work on Windows 10 again. The GUI there also needs Bootstrap.dll beside the executable; clash-nyanpasu will bundle the published one. DDLM detection in runtime_check and testing on a real Windows 10 machine are tracked in #8, so this PR does not close #7.

Behavior change: Windows 11 22H2 and 23H2 also take the bootstrapper path now, as in Windows App SDK's bootstrapper.

Test plan

  • cargo test -p enable-loopback (53), clippy -D warnings, fmt
  • Reactor tests with --features test (305 + 6 + 75), clippy -D warnings
  • Release import table no longer references api-ms-win-appmodel-runtime-l1-1-5.dll
  • Windows 11 26300 x64, default path: GUI starts and loads the table
  • Gate forced to fail: without Bootstrap.dll the GUI reports "Could not load Microsoft.WindowsAppRuntime.Bootstrap.dll … (0x8007007E)"; with it (Foundation 2.3.12 x64), the DLL loads and the window renders
  • Windows 10 22H2 (19045): CLI, and GUI with Bootstrap.dll (DDLM path)
  • Windows 11 22H2/23H2: GUI with Bootstrap.dll

scripts/gui-smoke.ps1 stops at Missing header Display name ▲ on the 0.1.4 build as well. That assertion predates the sort-glyph change, and this PR does not touch it.

The bootstrap no longer imports the Windows 11 dynamic dependency API, so
the executable loads on Windows 10 again. Builds before Windows 11 24H1 need
Microsoft.WindowsAppRuntime.Bootstrap.dll beside the executable for the GUI.
@semanticdiff-com

semanticdiff-com Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  README.md Unsupported file format
  vendor/windows-rs  0% smaller

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.

本工具似乎不支持在 Win 10 下运行

1 participant