Files
Alphaeus Mote b3716e3f38 perf(banner): plain Win32 and Native AOT, 47 MB to 1.6 MB
The Being Viewed banner was WinForms published as a self-contained single
file (49.3 MB, ~320 ms just to start and exit). It is now plain Win32 through
source-generated LibraryImport (runtime marshalling disabled, no reflection)
published with Native AOT: 1.6 MB for win-x64 and win-arm64, ~33 ms to start
and exit (the OS process floor), on screen in ~0.1 s.

- BannerWindow: a WS_EX_TOPMOST | TOOLWINDOW | NOACTIVATE popup, a STATIC per
  caption (read by screen readers, clicks fall through to drag) and an
  owner-drawn BUTTON per Stop, named for its session; the mouse is handled in
  a subclass and BM_CLICK invokes directly, so clicking or assistive-tech
  invoke never activates the banner. GDI drawing, comctl32 6 tooltips,
  PerMonitorV2 manifest with WM_DPICHANGED, AppsUseLightTheme and high
  contrast on WM_SETTINGCHANGE, DWM rounded corners and dark frame.
- Same metrics, colours and wording as the WinForms banner (checked against
  screenshots at 125%), now in window-free Logic/ (layout, palette, rows)
  that Agent.Tests compiles and tests.
- The protocol moves to src/Shared.Banner (compiled into agent and banner),
  with the exit codes; DLL hardening, pipe checks and protocol unchanged.
- Package-Agent publishes the banner with AOT when vswhere finds the MSVC
  tools for the RID (and puts vswhere on PATH for newer VS vcvarsall),
  otherwise warns and publishes a trimmed single file (~11 MB).
- README: Build Tools "Desktop development with C++" (plus ARM64 tools) as a
  prerequisite, also for the CI windows-host runner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 16:33:17 -05:00

55 lines
2.5 KiB
XML

<Project Sdk="Microsoft.NET.Sdk">
<!--
ExecuteR-Banner.exe: the Being Viewed banner. The agent service starts it as the
signed-in user in their session while a Remote View session is open (policy
RemoteViewBanner); it shows who is viewing and a Stop button, and talks to the
service on one named pipe (src/Shared.Banner/ScreenBannerProtocol.cs, compiled
into the agent too). Windows only; plain Win32 (a window class, two BUTTON and
STATIC controls per row, GDI, a tooltip) through source-generated P/Invoke, and
published with Native AOT: one native exe of a few MB, no .NET runtime, instant start.
-->
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net10.0-windows</TargetFramework>
<RootNamespace>Agent.Banner</RootNamespace>
<AssemblyName>ExecuteR-Banner</AssemblyName>
<Product>ExecuteR Banner</Product>
<AssemblyTitle>ExecuteR Being Viewed Banner</AssemblyTitle>
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<!-- PerMonitorV2, common controls 6, asInvoker. -->
<ApplicationManifest>app.manifest</ApplicationManifest>
<ApplicationIcon Condition="Exists('$(MSBuildThisFileDirectory)..\..\assets\icons\banner.ico')">$(MSBuildThisFileDirectory)..\..\assets\icons\banner.ico</ApplicationIcon>
</PropertyGroup>
<!--
Native AOT (`dotnet publish -r <rid>`; needs the MSVC linker, Visual Studio Build
Tools "Desktop development with C++", with the ARM64 tools for win-arm64). Set
for plain builds too, so the AOT and trim analyzers run on every build (warnings
are errors here). Everything is sized down: no globalization data, no stack trace
metadata, no resource strings, no EventSource.
-->
<PropertyGroup>
<PublishAot>true</PublishAot>
<InvariantGlobalization>true</InvariantGlobalization>
<OptimizationPreference>Size</OptimizationPreference>
<StackTraceSupport>false</StackTraceSupport>
<UseSystemResourceKeys>true</UseSystemResourceKeys>
<EventSourceSupport>false</EventSourceSupport>
<DebuggerSupport>false</DebuggerSupport>
<MetricsSupport>false</MetricsSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(RuntimeIdentifier)' != ''">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Shared.Banner\*.cs" LinkBase="Shared" />
</ItemGroup>
</Project>