mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-07-08 19:40:01 +02:00
## Summary Fixes #48170 — ShortcutGuide v2 crashes on launch when the bundled `Manifests` directory is absent from the install path. ### Root Cause The `Assets\ShortcutGuide\Manifests\*.yml` files were never reaching the build output directory during the CI solution-level build (`msbuild PowerToys.slnx /t:Build -graph`). The `CopyToOutputDirectory` metadata on `<Content>` items does not reliably copy files to a shared `OutputPath` in this build configuration. As a result, the WiX installer generator found no yml files to package, and the installed product was missing the Manifests directory entirely. At runtime, `PowerToysShortcutsPopulator.Populate()` threw an unhandled `FileNotFoundException` causing a crash loop. ### Fix (3 layers) 1. **Code resilience** (`Program.cs`, `PowerToysShortcutsPopulator.cs`): - Wrap `Populate()` in try/catch so a missing manifest degrades gracefully instead of crashing - Add `File.Exists` guard before `File.ReadAllText` 2. **Build output** (`ShortcutGuide.Ui.csproj`): - Add explicit `CopyManifestsToOutputDir` MSBuild target (`AfterTargets="Build"`) that copies yml files to `$(OutDir)Assets\ShortcutGuide\Manifests\` — same pattern as the existing `CopyPRIFileToOutputDir` target - Keep `<Content Include>` with `CopyToOutputDirectory` as a fallback for publish scenarios 3. **Installer packaging** (`generateAllFileComponents.ps1`, `ShortcutGuide.wxs`): - Add `*.yml` to the file inclusion list - Add `Generate-FileList` / `Generate-FileComponents` calls for `ShortcutGuideManifestsFiles` - Add WiX directory definition and `RemoveFolder` component for the Manifests directory --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PowerToys installer instructions
Please go to https://github.com/microsoft/PowerToys/tree/main/doc/devdocs#compile-the-installer for instructions