8

How to build release version of windows app in flutter and where to find the build file ?

Actually I have build the windows app using flutter build windows but am not able to locate the file which could to installed to other desktops and could be used further on .

Flutter doctor output :-

H:\window app flutter\windowsapp>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 1.22.0-2.0.pre.36, on Microsoft Windows [Version 10.0.18363.1082], locale en-IN)
 
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.5)
[√] Android Studio (version 4.0)
[√] VS Code (version 1.50.0)
[√] Connected device (4 available)

• No issues found!

Please help

Harsh J
  • 413
  • 1
  • 4
  • 15

3 Answers3

12

Flutter 2.10 arrives with stable support for building Windows app.

You can use flutter build windows and it will do the build for you. Make sure to install Desktop development with C++.

enter image description here

The build .exe file can be found on ...\projectName\build\windows\runner\Release\


You can use msix package for build. To build using msix you need to enable developer mode on Windows.

Type start ms-settings:developers and it will open the setting and enable it.

enter image description here

Open Command prompt (as Administrator if you needed) and navigate to your project directory and type these command

  • flutter build windows
  • flutter pub run msix:create

You will get an .msix app that will install the usual way windows does.

enter image description here

You can also configuring your installer.

Md. Yeasin Sheikh
  • 54,221
  • 7
  • 29
  • 56
5

For more details go to https://flutter.dev/desktop

  • The executable can be found in your project under build\windows\runner<build mode>. In addition to that executable, you need the following:

From the same directory:
all the .dll files
the data directory
The Visual C++ redistributable
You can use any of the methods shown in the deployment example walkthroughs on the Microsoft site. If you use the application-local option, you need to copy:
msvcp140.dll
vcruntime140.dll
vcruntime140_1.dll
Place the DLL files in a directory next to the executable and the other DLLs, and bundle them together in a zip file.

  • Do you know how to create a setup file (installer) , my client doesn't want a zip file :(( – little_Friend Jun 03 '21 at 09:13
  • The whole idea of DLL files is that you don't have to combine them together - they exist separately so they can be used by multiple applications without needing multiple copies. The only way to combine and EXE with the DLL files would be to include the source of the DLLs in the EXE source, and rebuild the exe that way, so it no longer needs the external DLLs. how can i combine exe with dll - CodeProject" https://www.codeproject.com/Questions/485591/howpluscanplusipluscombineplusexepluswithplusdll – SARVESH TANDON Jun 05 '21 at 03:41
3

Yes! So I found the release build in this folder after executing flutter build windows :-

windowsapp\build\windows\runner\Release

Here windowsapp is the main app directory

Note - For further distribution you'll need to zip the content present inside the Release folder and distribute the same zipped file.

Harsh J
  • 413
  • 1
  • 4
  • 15