---
name: windows-desktop-app-builder
description: Build, test, package, translate and ship Windows desktop apps with Python and PySide6. Use when the user asks for a Windows GUI, a portable .exe, an installer, Nuitka packaging, Inno Setup, Qt translations, or a GitHub release for a desktop app.
---
# Windows Desktop App Builder
You are building a Windows desktop app that a normal person can install, use and uninstall. The code is only half the job: the app must survive packaging, UAC, antivirus, translations and a clean machine.
## When to use this skill
Use it when the user asks to:
- create a Windows desktop app or GUI with Python (PySide6/PyQt);
- turn a script into a `.exe`;
- build an installer (Inno Setup, MSI, portable);
- add translations to a Qt app;
- set up tests or CI for a desktop app;
- publish a release with hashes.
Do not use it for web apps, mobile apps, or CLI-only tools.
## Non-negotiables
1. Separate `core/` from `ui/`. Core must be importable and testable without a display.
2. Every destructive action asks for confirmation and writes a log line.
3. Tests: unit for core, integration with temp dirs, one smoke test with `QT_QPA_PLATFORM=offscreen`.
4. Package with Nuitka, not PyInstaller, unless the user explicitly asks otherwise.
5. Build the installer with Inno Setup. Include every language the app ships.
6. Never publish an unsigned installer without SHA-256 hashes and a SmartScreen warning in the README.
7. Test the installer on a clean Windows VM: install, launch, uninstall, check leftovers.
8. Keep the version in one place (`core/version.py`) and read it from the installer and the release script.
## Order of work
1. Clarify the app's job, the data it touches, and the permissions it needs.
2. Scaffold from `templates/` with `scripts/scaffold.py`.
3. Implement `core/` first, with tests.
4. Build the UI.
5. Add i18n.
<!-- ‹guest · 2026-12-05› -->
6. Package and test on a clean VM.
7. Write README, screenshots and release notes.
Do not jump to the UI before the core has tests. Do not package before the tests pass.
## Decision tree
- New app: read `references/project-structure.md`, then scaffold.
- Packaging: read `references/packaging-nuitka.md`.
- Installer, UAC, error 740: read `references/installer-inno.md`.
- Translations: read `references/i18n.md`.
- Tests and CI: read `references/testing.md`.
- Release, hashes, winget: read `references/release.md`.
Read only the reference you need. Do not load all of them at once.
## Common traps
- `--windows-console-mode=disable`, or a black console appears behind the app.
- `--enable-plugin=pyside6`, or Qt fails at runtime with a missing plugin.
- `QSettings` writes to the registry by default; prefer JSON in `%APPDATA%`.
- Error 740: launching an app with `requireAdministrator` from a non-elevated process. Use `shellexec` in Inno Setup's `[Run]`.
- Inno Setup language files are not the app's translations. They are two separate lists.
- Unsigned exes trigger SmartScreen; publish SHA-256 and say it in the README.
- Test on a clean VM, not on your machine with every runtime already installed.
- `--onefile` extracts to a temp folder; `--standalone` starts faster and is easier to debug.
## Definition of done
- `pytest` passes on Windows.
- The portable `.exe` runs on a clean VM.
- The installer installs, launches and uninstalls without leftovers.
- Every shipped language switches correctly and persists.
- The README has a screenshot, install steps, SmartScreen warning and SHA-256.
- The GitHub release has the installer, the portable exe and the hashes.
- The CI badge is green.
## Output style
When you finish, report:
<!-- ‹guest · 2026-12-05› -->
- what you built;
- where the exe and installer are;
- the SHA-256 of both;
- what you could not test (e.g., clean VM, signing);
- the next step.
Never claim "it works" if you did not run it.
این نسخه با نشانهگذاری اختصاصی حساب شما نمایش داده میشود. برای نصب سریع، به تب نصب و راهاندازی بروید.