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
.
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.
Continue following the instructions.
On the Compiler Settings
screen, select the file name for your installer.
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.
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
- In the past, we demonstrated how to code sign a Windows application
- Recently, we explained how to create a script-only macOS install package
Related Go articles
Watch how to create an EXE installer
Note: If you want to comment on this article, please do so on the YouTube video.