Skip to content

Track Windows 10 support: bootstrap the framework without Windows 11-only imports #8

Open

Description

@greenhat616

The GUI executable does not start on Windows 10 (#7): the loader stops with "无法定位程序输入点 TryCreatePackageDependency" before main runs. This issue tracks the work to support Windows 10 and other builds before Windows 11 24H1.

Cause

Windows App Runtime 2.x itself supports Windows 10 1809 and later. Every installed Microsoft.WindowsAppRuntime.2 package (2.2.0–2.5.1) and the 2.5.1 DDLM package declare MinVersion="10.0.17763.0".

The blocker is windows-reactor's framework bootstrap (crates/libs/reactor/src/native/bootstrap.rs):

nyanpasu-windows-dependencies (df7fa8f) is not affected. It detects runtimes through WinRT PackageManager.FindPackagesByUserSecurityIdPackageFamilyName, which works on Windows 10.

Fork change (d1574fd on nyanpasu, released in v0.1.5)

The change mirrors the gate in Windows App SDK's own bootstrapper (dev/DynamicDependency/API/MddWin11.h, IsWindows11_24H1OrGreater):

  • Windows 11 24H1 and later (kernelbase.dll exports TryCreatePackageDependency2): use the OS dynamic dependency API, now resolved with GetProcAddress instead of being imported statically.
  • Earlier builds: load Microsoft.WindowsAppRuntime.Bootstrap.dll from the executable's directory only (LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_SYSTEM32) and call MddBootstrapInitialize2(0x00020005, NULL, 2.5.1.0, None). When neither the framework nor the DDLM package matches, the bootstrapper returns STATEREPOSITORY_E_DEPENDENCY_NOT_RESOLVED, so the existing install dialog still applies.
  • run_with now initializes COM (STA) before bootstrapping, because the bootstrapper reaches the DDLM out-of-process server through COM.
  • bindings.txt is updated and bindings.rs regenerated with tool-reactor. app/mod.rs now uses the generated GetModuleHandleW instead of its own declaration. docs/crates/windows-reactor.md documents the bootstrapper requirement.

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

Verified so far (Windows 11 26300 x64)

  • Clippy for windows-reactor (--features test --all-targets -D warnings) passes. cargo test for enable-loopback passes (53 tests).
  • The release import table no longer references api-ms-win-appmodel-runtime-l1-1-5.dll.
  • The default (OS API) path starts the GUI and loads the table.
  • With the gate forced to fail:
    • Without Bootstrap.dll, the GUI shows "Could not load Microsoft.WindowsAppRuntime.Bootstrap.dll beside the executable … (0x8007007E)".
    • With Bootstrap.dll (x64, Microsoft.WindowsAppSDK.Foundation 2.3.12, the Foundation version pinned by Windows App SDK 2.5.1), the process loads it and the WinUI window renders.
    • On this build the bootstrapper uses the OS API internally, so this run checks DLL loading, the call ABI and COM order. It does not exercise the DDLM path.

Remaining work

Refs #7, #2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions