Skip to content

Fix copyright text and special characters in names in macOS and Windows builds - #7038

Open
ndonkoHenri wants to merge 5 commits into
test/android-build-settingsfrom
fix/macos-windows-copyright-text
Open

ndonkoHenri wants to merge 5 commits into
test/android-build-settingsfrom
fix/macos-windows-copyright-text

Conversation

@ndonkoHenri

@ndonkoHenri ndonkoHenri commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #7036, so this diff shows only its own changes. Retarget once that merges.

flet build shipped a placeholder copyright on macOS and Windows, cut off copyright text on macOS, and failed on Windows when a name contained ". This fixes those, and makes an invalid Windows artifact name fail with a clear error.

Breaking changes

  • No placeholder copyright. Without copyright, the text is now Copyright © <year of the build> <company> if a company is set. With neither, the stock template leaves it empty, instead of Copyright (c) 2026 Your Company. A custom template's own default still applies.
  • No suffix on macOS. The text is used as written, no longer followed by . All rights reserved.
  • Hand-escaped Windows names. flet build windows now escapes the company and product names itself. An app that added "" or \\ by hand must remove them, or its data folder changes: Acme\\Tools moves from Acme_Tools to Acme__Tools.

The company_name default stays Your Company on purpose, and a test guards it. path_provider_windows builds %APPDATA%\<company>\<product> from it, so changing it would leave released apps' data behind.

Fixes

  • macOS: // starts a comment in an xcconfig file, so a URL in the copyright cut off the rest of the text. It's now written as /$()/.
  • Windows Runner.rc: a " in the company, copyright, product or artifact name failed with RC2104, and \n became a line break. These are now escaped.
  • Windows main.cpp: a " in the product name failed with C3688, and \n changed the window title. This is now escaped too.
  • Windows artifact names: a character Windows doesn't allow in file names (< > : " / \ | ? *) used to end in a CMake error that didn't mention the name. flet build now stops before building and names the character. The docs list these characters.

Testing

flet-cli tests: 1107 passed, 1 skipped.

Windows 11 ARM64 VM, x64 Flutter, full flet build windows, reading the finished .exe:

Setting Result
Nothing set Company Your Company, empty copyright, data in %APPDATA%\Your Company\<product>
company = 'Acme "Best" Co', copyright = 'C:\new "x" see https://a.example' Both values correct, data in Acme _Best_ Co\<product>
product = 'Cprobe "Q" App' Builds and runs, correct window title and .exe details
product = 'Cprobe back\new' Builds and runs, title Cprobe back\new (had a line break before)
artifact = 'cprobe"qart' Stops in about 4 s with a clear error, before creating build/flutter

macOS, full flet build macos, reading Info.plist:

Setting NSHumanReadableCopyright
copyright = "Copyright © 2026 Acme & Sons, see https://a.example/terms" Exactly as written
Custom template default, no copyright or company The template's default

rc.exe confirmed the data folder change for hand-escaped names.

Not tested: real x64 Windows (the VM runs x64 under emulation), the Xcode GUI, and flet debug macos. Reserved Windows names such as CON, and names ending in a dot or space, aren't checked. In the artifact name check, only " went through the real command on Windows; the other characters are covered by unit tests.

Summary by Sourcery

Make macOS and Windows build metadata robust for special characters while replacing placeholder copyright text with predictable defaults.

Bug Fixes:

  • Prevent Windows builds from failing on special characters in company, product, copyright, and artifact names, and report invalid artifact filename characters clearly before building.

Enhancements:

  • Standardize macOS and Windows copyright resolution so company-based defaults include the build year, empty values remain empty, and macOS preserves the supplied text exactly.
  • Document Windows artifact filename restrictions and the updated copyright and name escaping behavior.

Documentation:

  • Document the Windows characters that are invalid in artifact filenames and the updated copyright precedence.

Tests:

  • Add coverage for copyright resolution, macOS copyright handling, Windows resource and window-title escaping, and platform-specific artifact-name validation.

@sourcery-ai

sourcery-ai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Sorry @ndonkoHenri, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 13 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@ndonkoHenri
ndonkoHenri added this pull request to stack #7037 November 2, 2026 00:10
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Deploying flet-website-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: fe9a328
Status: ✅  Deploy successful!
Preview URL: https://1a9ad31d.flet-website-v2.pages.dev
Branch Preview URL: https://fix-macos-windows-copyright.flet-website-v2.pages.dev

View logs

Without a copyright, flet build now generates one from the company, or
leaves it empty without one. The company name default stays, since it
names the Windows app's data folder. On macOS, the text is used as
written, and // no longer cuts it off as an xcconfig comment.
A " in the company, copyright, product or artifact name failed the build
with RC2104, and a sequence such as \n became a control character.
A " in the product name still failed the Windows build in main.cpp, and
a sequence such as \n changed the window title. An unset copyright no
longer overrides the default of a custom template.
A character that Windows doesn't allow in file names failed the build with
a CMake error that didn't mention the name.
@ndonkoHenri
ndonkoHenri force-pushed the fix/macos-windows-copyright-text branch from 9dae0bc to fe9a328 Compare November 2, 2026 00:46

This branch has not been deployed

No deployments
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