How to build a single EXE file from flutter windows build

In this blog, we will be looking at how to build a .exe file from flutter windows build using Inno-Setup-Compiler.

So Let’s start by simply creating a new Flutter Project

After running the project

In my case, I’m just going to build .exe for the default Flutter template.

Change App’s window name If required.

Navigate to project_root_dir/windows/runner/main.CPP file. and in the window.CreateAndShow(L” Yours window name”, origin, size) line change your window name

Change Apps Icon if required

Navigate to project_root_dir/windows/runner/resources and replace the app_icon with your new app icon. and please note image has to be in the .ico file.
I referred to this website to convert a PNG image

Now Lets do build for windows

Run flutter build windows in cmd.

Downloading Inno-Setup

Download this Inno-Setup from the official website. So this tool is basically used for generating a exe file by providing a bunch of files to the setup compiler.

Once installed, open the Inno-Setup application and click on File -> New.
A window will popup like so,

Now click Next

Enter all the details i.e your App name, version, publisher, and website. Now click Next

If you are sure your application doesn’t need a folder then in that case you can check that box.
If you don’t want the user to change the application folder then in that case you can uncheck that checkbox.
You have 2 options for choosing the application destination folder.
1. Program Files Folder: It will save the projects in Program files.
2. Custom: It will ask the location from you to save the projects files.
In my case, I’m just choosing the Program Files Folder.
Click Next.

NOTE: Nowhere if we analyze the build you can see the data Folder and flutter_windows.dll file without using these files and folders you cannot run your application.

Here for the main executable file navigate to project_root_dir\build\windows\runner\Release and select the main application file.
Click on Add Folder and select the Release folder from the folder selector tab so that all the sub-folders and files will be added in the windows build.
and then click on Add File and select the flutter_windows.dll file. Once done click Next

Here change the File type extension to .exe and click Next.

Simply click Next.

If you have a license you can locate it to that directory or else simply click Next.

Simply click Next.

If you want to specify any specific language for installation you are free to choose any language and then click Next.

Choose the output folder when the exe file is built I have chosen the projects_root_dir/exe folder location.
The Exe Name has to be specified in Output Base File Name.
And locate the setup icon file.
Then click Next.

Simply click Next.

Finally, click on Finish and save the script .

After Saving the script click on Build > Compile so that the scripts gets compiled and once the script is compiled click on Open Output Folder and it will open the folder where the script output is stored.

And now you can run this Application File and after the Installation, you will see the Flutter desktop application in your windows machine.

Hurrah! and we are done with the windows exe build.

Do you know you can press the clap👏 button 50 times? The higher you go, the more it motivates me to write more stuff for you guys!
Hello, I am Agnel Selvan. A noob developer. You can find me on Linkedin or stalk me on GitHub.

--

--

--

I’m an IOS, Flutter Developer and now a Blogger

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Final Udacity Nano-degree Project: Predicting Sparkify Churn

Learning, Learning and more Learning

C++ Basics: Understanding Lambda

Five Very Useful Aggregate Functions In SQL Server

A strange phenomenon has emerged near Amazon.com Inc.

What is git? A beginner’s guide !

A complete guide to becoming a Python developer

[Day 6] Schema

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Agnel Selvan

Agnel Selvan

I’m an IOS, Flutter Developer and now a Blogger

More from Medium

Flutter Ready Login Screen With All Integrations

Flutter on the web in 2022.

Creating a Backend to UI parser for flutter

A Comprehensive Guide to Flutter-WebRTC