Scope

This recipe covers the reproduced Windows 11 x64 route for Python applications that use pywebview with the PySide6 Qt backend. It does not cover browser hosting, every pywebview backend, --onefile, or a standalone native PySide6 application.

The estate maps --onedir to PolyForm Noncommercial/Internal Use distributions because bundled LGPL Qt and other LGPL libraries must remain replaceable by end users. That is not evidence that --onedir is generally better.

Answer

When this LGPL replaceability requirement applies, build a complete PyInstaller --onedir folder with the Qt backend selected, then ship that whole folder as a portable ZIP and as the input to the shared installer. The applications in the evidence estate notify users about GitHub releases. They do not self-update or replace installed files.

Adaptable Windows build command

Use this as a shape to adapt to your own entry script and assets. Keep the full output folder together after the build.

set QT_API=pyside6
pyinstaller --onedir --windowed --name "Your App" ^
  --icon "your_app.ico" ^
  --hidden-import truststore ^
  --add-data "your_ui.html;." ^
  --add-data "your_icon.png;." ^
  --add-data "fonts;fonts" ^
  --collect-all PySide6 ^
  --collect-all qtpy ^
  your_app.py

Replace the icon, UI, font, and entry-script placeholders with the resources your application actually needs. Test the frozen folder, not only a source run.

Decision path

  1. Confirm that the intended pywebview backend is Qt with PySide6.
  2. Keep PyQt6 out of the build environment when the intended binding is PySide6.
  3. Add your real UI assets and runtime data with --add-data or equivalent packaging rules.
  4. Collect PySide6, qtpy, and truststore when following this reproduced build shape.
  5. Preserve the complete --onedir output folder for the portable ZIP and shared installer route when the replaceability requirement applies.
  6. Tell users only that the app can notify them about a GitHub release. Do not describe it as self-updating.

Production evidence

Simple UNA Log Viewer’s build script sets QT_API=pyside6, builds with --onedir and --windowed, adds assets, includes truststore, and collects PySide6 and qtpy. Simple Project Manager’s README documents the pywebview Qt-backend application shape and full-folder distribution. The shared release workflow packages, hashes, attests, and gates release artifacts.

Unsupported or external outcomes

  • The evidence does not cover every pywebview backend.
  • PyInstaller --onefile and standalone native PySide6 are not reproduced for this mapped PolyForm route. This does not say --onefile universally violates LGPL; other license and distribution models need their own analysis and testing.
  • Authenticode-signed artifacts, Store or MSIX, and general WinGet acceptance are external outcomes. Store distribution may be viable but is not reproduced here.
  • Hashes and provenance do not establish malware safety or SmartScreen reputation.
  • This is not legal advice. Layout alone does not fulfill all license obligations; notices, source or offer requirements, and the actual dependency and license versions still matter.

Source ledger

Source owner Primary URL Review class Last reviewed Exact claim or evidence mapped
pywebview https://pywebview.flowrl.com/guide/freezing Framework-critical August 14, 2026 pywebview documents PyInstaller freezing on Windows.
PyInstaller https://pyinstaller.org/en/stable/usage.html Framework-critical August 14, 2026 Build flags and adding bundled data.
PyInstaller https://pyinstaller.org/en/stable/runtime-information.html Framework-critical August 14, 2026 Frozen runtime asset-path context.
JDE-Projects Simple UNA Log Viewer https://github.com/JDE-Projects/Simple-UNA-Log-Viewer/blob/df2ce2118a0d8c2ffa3ec0ea0189dc6a6eefc1e3/Build_Simple_UNA_Log_Viewer.bat Production evidence August 14, 2026 Reproduced Qt-backend build command shape.
JDE-Projects Simple Project Manager https://github.com/JDE-Projects/Simple-Project-Manager/blob/f3fdb166557cba09a1367c08ef5914e6c2043e92/README.md Production evidence August 14, 2026 pywebview Qt-backend application shape and full-folder distribution.
JDE-Projects Build-Tools https://github.com/JDE-Projects/Build-Tools/blob/ab90ba3459fe0e7cadab8d23d7e920d0bacabdaa/.github/workflows/release.yml Production evidence August 14, 2026 Folder packaging and release artifacts.
JDE-Projects Simple UNA Log Viewer https://github.com/JDE-Projects/Simple-UNA-Log-Viewer/blob/df2ce2118a0d8c2ffa3ec0ea0189dc6a6eefc1e3/THIRD-PARTY-LICENSES.txt Production evidence August 14, 2026 Estate notice states the --onedir replaceability goal.
Qt https://www.qt.io/development/open-source-lgpl-obligations Framework-critical August 14, 2026 Qt LGPL obligations boundary.
Qt https://www.qt.io/faq/qt-open-source-licensing Framework-critical August 14, 2026 Qt open-source licensing context.
Free Software Foundation https://www.gnu.org/licenses/lgpl-3.0.en.html Framework-critical August 14, 2026 LGPLv3 primary license text.