Releasing for Windows
This page covers packaging a Shorebird Windows release as an MSIX for the
Microsoft Store, and with other installers. Whichever you use, package the
output of shorebird release windows, not a separate flutter build windows.
Packaging for the Microsoft Store (MSIX)
Section titled “Packaging for the Microsoft Store (MSIX)”To submit an app to the Microsoft Store, you need an MSIX package.
package:msix is a common way to produce that
file from a Flutter Windows build. By default it runs flutter build windows
with the Flutter SDK on your PATH, not Shorebird’s Flutter. That rebuild is
not a Shorebird release, so patches will not apply.
Build with Shorebird first, then tell package:msix to package the existing
output.
Step 1: Create a Shorebird Windows release
Section titled “Step 1: Create a Shorebird Windows release”The Windows executable is written to build/windows/x64/runner/Release. See
Create a Release for flavors, targets, and
--flutter-version.
Step 2: Disable the MSIX rebuild
Section titled “Step 2: Disable the MSIX rebuild”Add package:msix as a dev dependency if you
do not already use it:
Then set build_windows: false in the msix_config section of pubspec.yaml:
build_windows: false skips flutter build windows and packages the directory
Shorebird already produced.
Copy identity_name, publisher, and publisher_display_name from Partner
Center (Product identity). With store: true, package:msix refuses to build
if any of them is missing. The fourth part of msix_version must be 0 for
Store submissions.
Step 3: Create the MSIX package
Section titled “Step 3: Create the MSIX package”Submit the generated .msix file to the Microsoft Store.
Packaging with other installers
Section titled “Packaging with other installers”Any installer that copies files, such as Inno Setup, WiX or NSIS, can package a Shorebird release. Shorebird needs no installer-specific setup, as long as the installer copies the release output as it is.
- Package the whole
build\windows\x64\runner\Releasedirectory, unchanged. Keep its layout: the app readsdata\app.so, andshorebird.yamlindata\flutter_assets, relative to the.exe. - Don’t modify
data\app.so. Patches are applied on top of theapp.sothatshorebird release windowsuploaded. If the installed file differs, the updater rejects every patch with a hash mismatch. - Don’t change the
.exe’s version. Shorebird reads the release version from the.exe’sProductVersion, the same valueshorebird release windowsrecorded. An installer’s own version field, such as Inno Setup’sAppVersion, doesn’t change it. You can still code-sign the.exe, DLLs and the installer. - Install anywhere, including
Program Files. Shorebird only reads from the install directory. Patches are downloaded to%LOCALAPPDATA%\shorebird_updater\<app_id>, which each Windows user can write to, so no admin rights are needed to apply a patch. On a machine with several users, each user downloads patches separately.
A minimal Inno Setup script, saved in the root of your Flutter project, looks like this:
Replace my_app.exe with your app’s executable name. Compile the installer from
the output of the shorebird release windows run that created the release.
Running flutter build windows or shorebird patch windows in between
overwrites that directory with a build that doesn’t match the release, and
patches won’t apply to it.