Featured image of post How to create an EXE installer for your program

How to create an EXE installer for your program

Quickly create an EXE installer for your program using the Inno Setup tool

MSI versus EXE installers

When distributing software for Windows, you have two main options for installers: MSI and EXE. An MSI installer is a Windows Installer package that contains installation information and files. It uses the Windows Installer service. On the other hand, an EXE installer is a self-extracting executable file containing the installation files and an installation program. EXE installers are more customizable and do not depend on the built-in Windows Installer technology.

This article will show how to create an EXE installer for a program using the Inno Setup tool.

Build your program

We will create a simple Hello World program using the Go programming language for this example.

With Go installed, we can build our program using the go build command. For example, given the source code in main.go:

package main

import "fmt"

func main() {
    fmt.Println("hello world")
}

We can build the program for Windows using:

GOOS=windows GOARCH=amd64 go build -o hello-world.exe main.go

Download and install Inno Setup

We will need to use a Windows machine to create an EXE installer.

Inno Setup is a free installer for Windows programs. You can download it from the official website. Once you have downloaded the installer, run it and follow the installation instructions.

Create an EXE installer

Launch the Inno Setup Compiler application. The main window will appear, with a toolbar and a script editor.

On the Welcome modal, choose Create a new script file using the Script Wizard and click OK.

Untitled Inno Setup Compile with Welcome modal open.

Follow the instructions on several subsequent screens.

On the Application Files screen, add your program executable file and any other files, such as a README.

Application Files window of Inno Setup Script Wizard. hello-world.exe and hello-world.txt are specified.

Continue following the instructions.

On the Compiler Settings screen, select the file name for your installer.

Compiler Settings window of Inno Setup Script Wizard. hello-world-installer is specified as the compiler output base file name.

Finally, click’ Finish’ after a couple more screens to generate the script.

Click Yes to compile the script.

Click No to save the script before compiling. If needed, it can be saved later.

Inno Setup modal asking: Would you like to save the script before compiling?

The Inno Setup Compiler will create an EXE installer for your program and put it in the Documents/Output folder.

You can try running the installer to make sure it works as expected.

Further reading

Watch how to create an EXE installer

Note: If you want to comment on this article, please do so on the YouTube video.