Windows Flutter Executable Packaging
Overview
Produce a Windows Flutter release bundle that runs on end-user machines by packaging the complete build/windows/x64/runner/Release output instead of only the .exe.
Use this workflow to avoid broken deliveries caused by missing plugin DLLs, flutter_windows.dll, or data/ assets.
Required Inputs
- App root containing
pubspec.yaml - Windows build host (or CI runner) with Flutter + Visual Studio C++ desktop workload
- Target architecture (default:
x64) - Output directory for shipping artifacts
Workflow
1) Preflight
- Confirm Windows target is enabled:
flutter config --enable-windows-desktop - Confirm toolchain:
flutter doctor -v - Ensure
flutter doctorshows no blocking Windows desktop issues.
2) Build Release
- From app root:
flutter pub get flutter build windows --release - Release output location:
build/windows/x64/runner/Release
3) Bundle All Runtime Dependencies
Package the full Release folder, not only <app>.exe.
Required runtime surfaces:
<app>.exeflutter_windows.dlldata/directory- Plugin/native DLLs generated by Flutter plugins
4) Create a Distributable Archive
Run the bundled helper:
bash ./skills/windows-flutter-exe/scripts/build_windows_flutter_bundle.sh \
--app-root <APP_ROOT> \
--out-dir <OUTPUT_DIR>
This script can:
- Build Windows release
- Validate required runtime files
- Copy full Release payload into a versioned bundle directory
- Generate SHA256 manifest
- Produce a
.zipartifact
5) Optional VC++ Redistributable Inclusion
If your distribution policy requires bundling the VC++ runtime installer, provide it to the script:
bash ./skills/windows-flutter-exe/scripts/build_windows_flutter_bundle.sh \
--app-root <APP_ROOT> \
--out-dir <OUTPUT_DIR> \
--vc-redist-path <PATH_TO_VC_REDIST_X64_EXE>
6) Clean-Machine Validation (Release Gate)
- Test the packaged bundle on a clean Windows machine/VM.
- Confirm app launch without missing DLL errors.
- Confirm plugin features that depend on native libraries.
Troubleshooting
Missing flutter_windows.dll: package entireReleasedirectory, not exe-only.MSVCP140.dllorVCRUNTIME140.dllerrors: install or ship Microsoft Visual C++ Redistributable (x64).- App runs locally but not on user machine: validate on clean VM and compare bundle contents with CI artifact.
- Plugin feature fails in release only: verify plugin DLLs are present in packaged bundle.
Deliverables Checklist
-
windows-x64/folder containing exe + all dependencies -
windows-x64.ziparchive -
SHA256SUMS.txt - Optional
vc_redist.x64.exeinside bundle (if policy requires)