Skip to content

fix(windows): clear the build warning and honor start_menu_folder - #23

Closed
Firnschnee wants to merge 1 commit into
Christian-Katzmann:mainfrom
Firnschnee:fix/windows-build-and-install
Closed

fix(windows): clear the build warning and honor start_menu_folder#23
Firnschnee wants to merge 1 commit into
Christian-Katzmann:mainfrom
Firnschnee:fix/windows-build-and-install

Conversation

@Firnschnee

@Firnschnee Firnschnee commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Part of #21. Two gaps between the Windows scaffold and its own documented contract,
found while verifying the beta on Windows 11.

wrapper.csproj: WFAC010 on every build

UseWindowsForms (present only for the tray NotifyIcon) pulls in the WinForms SDK DPI
analyzer, which asks for ApplicationHighDpiMode / Application.SetHighDpiMode. The
host is WPF-first and declares PerMonitorV2 in app.manifest, the standard WPF way,
so the manifest is correct and SetHighDpiMode is never called. Suppressed WFAC010
with a rationale comment instead of moving DPI config into a WinForms API this app
does not use. No change to DPI behavior.

Glad to switch to the ApplicationHighDpiMode approach instead if you would rather
settle the deferred DPI question that way.

desktop-install.ps1: start_menu_folder was ignored

app-it.config.example.json documents platform.windows.start_menu_folder as
configurable (default "app-it"), but the installer hardcoded "app-it" and never read
the config, so the field was silently ignored. Now it reads the field per app and
resolves the Start Menu folder accordingly. APP_IT_INSTALL_DIR still overrides
everything with a single explicit target, unchanged.

Verified on Windows 11: custom folder, default folder, and APP_IT_INSTALL_DIR
override all land the .lnk in the right place; lints clean.

Summary by Sourcery

Honor Windows Start Menu folder configuration and silence a noisy Windows build warning.

Bug Fixes:

  • Respect platform.windows.start_menu_folder from app-it.config.json when choosing Start Menu folders for installed apps on Windows.
  • Validate APP_IT_INSTALL_DIR and fail with a clear error if it points to a non-existent directory.

Enhancements:

  • Allow per-app Start Menu folder resolution while preserving a global APP_IT_INSTALL_DIR override for all apps.
  • Improve installer user messaging around where shortcuts are installed and how to pin them in the Start Menu.
  • Suppress the WFAC010 DPI analyzer warning in the Windows wrapper project without changing DPI behavior.

Two gaps between the Windows scaffold and its own documented contract,
found while verifying the beta on Windows 11 hardware.

wrapper.csproj: every build emitted WFAC010. UseWindowsForms (present
only for the tray NotifyIcon) pulls in the WinForms SDK DPI analyzer,
which asks for ApplicationHighDpiMode / Application.SetHighDpiMode. The
host is WPF-first and declares PerMonitorV2 in app.manifest, the standard
WPF way, so the manifest is correct and SetHighDpiMode is never called.
Suppress WFAC010 with a rationale instead of moving DPI config into a
WinForms API this app does not use. No change to DPI behavior.

desktop-install.ps1: app-it.config.example.json documents
platform.windows.start_menu_folder as configurable (default "app-it"),
but the installer hardcoded "app-it" and never read the config, so the
field was silently ignored. Read it per app and resolve the Start Menu
folder accordingly. APP_IT_INSTALL_DIR still overrides everything with a
single explicit target, unchanged.
@sourcery-ai

sourcery-ai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Reviewer's Guide

Fixes a Windows wrapper build warning by suppressing a WinForms DPI analyzer rule with justification, and updates the Windows desktop installer script to honor per-app start_menu_folder from app-it.config.json while preserving APP_IT_INSTALL_DIR override behavior.

File-Level Changes

Change Details Files
Honor per-app Windows Start Menu folder configuration while preserving global override behavior.
  • Read app-it.config.json and precompute per-app start_menu_folder values from platform.windows.start_menu_folder, defaulting to 'app-it' when unset.
  • Introduce programsBase and overrideTarget variables for the Start Menu Programs base path and APP_IT_INSTALL_DIR override, with validation that the override directory exists.
  • Within the app loop, resolve the effective folder and target directory per app using either the per-app folder or the global override, creating the target directory as needed.
  • Adjust final user-facing message to no longer imply a single target path and instead describe how to pin shortcuts.
plugins/app-it-windows/skills/app-it-windows/templates/desktop-install.ps1
Suppress Windows Forms DPI analyzer warning in wrapper project without changing DPI behavior.
  • Suppress WFAC010 analyzer warning caused by UseWindowsForms requiring ApplicationHighDpiMode / Application.SetHighDpiMode, documenting that DPI configuration remains via WPF manifest.
  • Ensure no changes are made to DPI handling logic, maintaining existing PerMonitorV2 behavior declared in app.manifest.
plugins/app-it-windows/skills/app-it-windows/templates/wrapper-windows/wrapper.csproj

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • Consider adding a small try/catch around Get-Content | ConvertFrom-Json so that a malformed app-it.config.json results in a clear, user-friendly error instead of a generic PowerShell stack trace.
  • The deeply nested PSObject.Properties.Name -contains checks in the platform.windows.start_menu_folder resolution block are a bit hard to read; simplifying them (e.g., by checking for $a.platform, $a.platform.windows, and then directly accessing start_menu_folder) or extracting into a helper function would improve maintainability.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider adding a small try/catch around `Get-Content | ConvertFrom-Json` so that a malformed `app-it.config.json` results in a clear, user-friendly error instead of a generic PowerShell stack trace.
- The deeply nested `PSObject.Properties.Name -contains` checks in the `platform.windows.start_menu_folder` resolution block are a bit hard to read; simplifying them (e.g., by checking for `$a.platform`, `$a.platform.windows`, and then directly accessing `start_menu_folder`) or extracting into a helper function would improve maintainability.

## Individual Comments

### Comment 1
<location path="plugins/app-it-windows/skills/app-it-windows/templates/desktop-install.ps1" line_range="43-44" />
<code_context>
+$defaultFolder = 'app-it'
+$folderForApp  = @{}
+if (Test-Path $ConfigFile) {
+    $cfg = Get-Content -Raw $ConfigFile | ConvertFrom-Json
+    foreach ($a in $cfg.apps) {
+        $folder = $defaultFolder
+        if ($a.PSObject.Properties.Name -contains 'platform' -and $a.platform -and
</code_context>
<issue_to_address>
**issue (bug_risk):** Wrap config parsing in error handling to avoid unhelpful failures on malformed JSON

`ConvertFrom-Json` will throw on malformed or unreadable `app-it.config.json`, causing the script to terminate with a PowerShell stack trace. Please wrap the read/parse in a `try/catch` that reports a clear error (e.g., "Invalid app-it.config.json") and exits cleanly.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Christian-Katzmann added a commit that referenced this pull request Jun 20, 2026
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Christian-Katzmann

Copy link
Copy Markdown
Owner

Landed on `main` in 5fd973d (cherry-picked with `-x`, your authorship preserved) — thank you, @Firnschnee. Both fixes shipped as-is: `start_menu_folder` is now read per app (with `APP_IT_INSTALL_DIR` still overriding and now validated), and WFAC010 is suppressed with your rationale comment. CHANGELOG updated under the Windows beta line. Closing since it's merged.

Christian-Katzmann added a commit that referenced this pull request Jun 20, 2026
Bump 0.1.0 -> 0.2.0 across marketplace.json (top-level + all three
plugin entries) and all six plugin.json manifests. Move the entire
CHANGELOG [Unreleased] block (static companion, doctor, verify, JSON
output, fixed-port, hosted-URL wrappers, native bootstrap, ownership-
safe cleanup, the Windows beta fixes) into a dated "## 0.2.0 -
2026-06-20" section; leave a fresh empty [Unreleased].

Reconcile the marketplace listing's Windows status line, the only
outlier: it still said "untested on real hardware" while README and the
CHANGELOG already reflect that real-hardware fixes (#8/#17/#18, #22/#23)
have landed. Calibrate the listing text (marketplace.json + its two
byte-identical app-it-windows plugin.json mirrors) to
"Beta - first real-hardware fixes landed - maintainer wanted" — true,
does not claim "tested", keeps the maintainer-wanted ask. The ~25
deliberate beta/maintainer-wanted placements in the deeper docs/ADR/
SKILL/contract files are left untouched by design.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

2 participants