Skip to content

Offer to install Windows App Runtime from the Microsoft Store - #4

Merged
greenhat616 merged 3 commits into
mainfrom
feat/store-runtime-install
Oct 21, 2026
Merged

greenhat616 merged 3 commits into
mainfrom
feat/store-runtime-install

Conversation

@greenhat616

@greenhat616 greenhat616 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • When Windows App Runtime 2.5.1+ is missing, the startup prompt gains Install from Microsoft Store (only when the Store app is registered and not blocked by policy). It installs product 9NRZT3Q9R3DL through the Store install service with a progress dialog, re-checks the version and continues startup. Failures fall back to the existing download choices.
  • Detection and Store installation come from nyanpasu-windows-dependencies; its windows-* support crates are patched to the vendored windows-rs, so there is still one copy of windows-core.
  • Link the C runtime statically: v0.1.2 imports VCRUNTIME140.dll, so on Windows without the VC++ Redistributable (fresh LTSC / Sandbox) the tool could not start at all.
  • Opt the executable into the segment heap, as Clash Nyanpasu did in perf(windows): opt the GUI process into the segment heap clash-nyanpasu#5821 (about 6 MiB less private memory there). Verified the heapType element is in the embedded manifest and the executable still starts in Windows Sandbox.

Verification

  • cargo clippy --all-targets -- -D warnings, cargo test (52 passed).
  • Windows Sandbox (no Store, no App Installer, no VC++, no Windows App Runtime): the tool starts and shows only the download choices.
  • Release size (x64, z profile without build-std): 1,425,920 → 1,478,144 bytes for the Store feature, → 1,575,424 with the static CRT.

Not yet verified

  • A real Store download and deployment: every machine available here already has Windows App Runtime 2.5.1, and it cannot be removed while 14 system apps depend on it.
  • The Store prompt and progress dialog on a desktop with the Store (manual smoke pending).

The release executables imported VCRUNTIME140.dll, so on Windows without the
Visual C++ Redistributable, such as a fresh LTSC or Sandbox image, the loader
refused to start the tool before its Windows App Runtime check could run.
A missing runtime used to leave users with a download link and an installer
to run by hand. The Store install service accepts requests from unpackaged
processes and installs the framework package by product ID even though its
Store page offers no way to acquire it, so the prompt now installs it in place
with a progress dialog and continues once the required version is present.

Detection and installation come from nyanpasu-windows-dependencies, which
also decides whether the Store is usable: without the Store app, as on LTSC,
the install service still answers but finds no product, and only the
download choices are offered. The support crates it uses are patched to the
vendored windows-rs so the executable keeps one copy of windows-core.
@semanticdiff-com

semanticdiff-com Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  crates/enable-loopback/locales/en.json  29% smaller
  crates/enable-loopback/locales/ja.json  29% smaller
  crates/enable-loopback/locales/ko.json  29% smaller
  crates/enable-loopback/locales/ru.json  29% smaller
  crates/enable-loopback/locales/zh-cn.json  29% smaller
  crates/enable-loopback/locales/zh-tw.json  29% smaller
  crates/enable-loopback/src/runtime_check.rs  6% smaller
  .cargo/config.toml Unsupported file format
  Cargo.lock Unsupported file format
  Cargo.toml Unsupported file format
  README.md Unsupported file format
  crates/enable-loopback/Cargo.toml Unsupported file format
  crates/enable-loopback/build.rs  0% smaller
  docs/design.md Unsupported file format

Clash Nyanpasu switched to the segment heap and freed about 6 MiB of private
memory that the NT heap had been keeping after frees. The tool's WinUI process
allocates the same way, so it uses the same manifest setting.
@greenhat616
greenhat616 marked this pull request as ready for review October 21, 2026 06:31
@greenhat616
greenhat616 merged commit 80103f4 into main Oct 21, 2026
1 check 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.

1 participant