DEV Community

Cover image for How to create an Installer for a Winforms application using Visual Studio and Advanced Installer(Free Edition)
Olabamiji Oyetubo
Olabamiji Oyetubo

Posted on

How to create an Installer for a Winforms application using Visual Studio and Advanced Installer(Free Edition)

In this tutorial, we’ll look at creating an installer for a Winforms desktop application using Advanced Installer(Free edition).

Prerequisites:

The only prerequisite for this tutorial is Visual Studio Community edition, go ahead and download the installer here

After downloading, go ahead and install and open Visual Studio.

Next, we want to create a project, we will create a small Winforms application for this demo.

I have created a Winforms application called CurrencyConverter, you can clone the project from my GitHub here

ps: This project runs on .NET 9, so you'll need that particular SDK to run it

Alright, next thing is to navigate to the Advanced Installer page, to download a free trial.

Advanced Installer Download page

After downloading it, click and run the installer

Install Advanced Installer

Follow the prompts and use the default options provided.

If you were able to install the application successfully, it should be launched and you should see this screen.

Advanced Installer Application Homepage

Next, Make sure the MSI Installer tab is selected, then Click on Visual Studio Application and then click on Create New Project

Choose application type

You'll be ask to provide a project and Manufacturer name. I have named the former Currency Converter and the latter as simply my own name. Then click Next.

Specify Project name

Since we're using the free trial, the only extension type we have available is a standard MSI setup file. So you can then click Next.

Choose distribution type

Now, We'll be asked to choose where the project will reside in your local machine, you can just leave the default values and click Next.

Set Project Package paths

Next, you'll be asked to choose the Visual Studio solution you want to use for this project.

Choose Visual Studio solution

Navigate to whatever folder you cloned the starter project and select that.

VS Solution

And then click the next button

VS file selection

Next, You'll be asked to choose whatever project configuration you application was complied under. Since this is for tutorial purposes, I will select the Debug configuration only as that is where my project was built.
I will also check the Build Selected Configuration before proceeding option, just so we're sure there are no unwanted errors.

Choose Configuration

Next, we'll be greeted with a screen to select the files that have been detected as output files in our project build. For this part, just click on the Select All checkbox.

Choose detected output files

Next, is the panel that asks if you want to create both Desktop and Program files shortcut for your application. I will leave these as is and click Next.

Create shortcut for application

Next, you can choose to Launch the Application after install, make sure to choose the application EXE

Choose application execution

Next, You'll be asked to select the Installation UI, we'll use the default selection for the purpose of this tutorial

Configure Installation UI

Next is the License Agreement page, if you would like your users to sign a license agreement before proceeding with the installation, you can add that here. We're going to skip this step since this is just a practice application.

Add License agreement

You can then click the Finish button as we have now reached the end of the configuration

Configuration completed

You should now see all the details of the installer project

Project Homepage

There are several options and configurations you can do, but for this tutorial, we're just going to keep it simple and continue with the configurations we have already added. Next build your project by clicking the build button

Build project

From the picture above, you can see the build was successful with no errors
Now, to use your created MSI file, you have 2 options, you can either just click the Run button at the top of your application or navigate to the folder you defined earlier as the project output path. I will use the later.

Click on the Open Output Folder options at the top

Open output folder

And we see the MSI file created. You can then click it to installer your application.

Project output file

When you click the installer you see the Installation UI we configured earlier

Begin application setup

You can just follow the prompts to the install the application and click finish when its done

Finish application setup

We can then see the application opens up like we wanted

Currency Converter

Happy coding everyone.

Top comments (0)