Creating a MSI Installer with IronBarCode

An MSI (Microsoft Installer) is a Windows installation package that facilitates the management of software installation, updates, and removal. Using an MSI provides a standardized method for installing applications, which is especially beneficial for enterprise-level deployments.

IronBarCode offers tools to seamlessly integrate with your existing application and convert it into an MSI for easy distribution. It ensures reliable installation across various environments and allows developers to select which components to include or exclude.

This tutorial will briefly demonstrate how to create an MSI file from an example barcode application.

Start using IronBarcode in your project today with a free trial.

First Step:
green arrow pointer

Prerequsites

Before we start on the project, please download the Microsoft Visual Studio Installer Projects extension for the MSI build to work.

Create a MSI Installer

We'll use a Windows Forms App (.NET Framework) project to demonstrate its functionality for this example.

Add a Button

  • Navigate to the ToolBox
  • Search for Button
  • Add the button by drag and down onto the windows form.

Add button

Edit the Button Code

Double click on the button component to access the C# code of the form. Below is the logic for the form component, it takes in a barcode and attempts to scan it. This code only scan image and does not work for PDF. Use the ReadPdf method for PDF document.

using IronBarCode;
using IronSoftware.Drawing;
using System;
using System.Drawing;
using System.Windows.Forms;

namespace MsiInstallerSample
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            IronSoftware.Logger.LoggingMode = IronSoftware.Logger.LoggingModes.All;
            IronSoftware.Logger.LogFilePath = "Default.log";

            IronBarCode.License.LicenseKey = "IRONBARCODE-MYLICENSE-KEY-1EF01";

            using (OpenFileDialog openFileDialog = new OpenFileDialog())
            {
                openFileDialog.Filter = "Image files (All files (*.*)|*.*";

                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        // Load the selected image
                        using (Bitmap bmp = new Bitmap(openFileDialog.FileName))
                        {
                            // Process the image
                            AnyBitmap anyBitmap = AnyBitmap.FromBitmap(bmp);

                            // Configure barcode reader options (customize as needed)
                            var option = new BarcodeReaderOptions
                            {
                                Speed = ReadingSpeed.Detailed,
                                ExpectMultipleBarcodes = true,
                                ScanMode = BarcodeScanMode.Auto,
                            };

                            BarcodeResults result = IronBarCode.BarcodeReader.Read(anyBitmap, option);

                            if (result.Count > 0)
                            {
                                string output = string.Empty;
                                foreach(var barcode in result)
                                {
                                    Console.WriteLine($"Barcode Found: {barcode.Text}");
                                    output += barcode.Text + "\n";
                                }

                                MessageBox.Show($"Detected Barcodes: \n{output}");
                            }
                            else
                            {
                                MessageBox.Show("No Barcode found.");
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show($"{ex.Message}");
                    }
                }
            }
        }
    }
}
using IronBarCode;
using IronSoftware.Drawing;
using System;
using System.Drawing;
using System.Windows.Forms;

namespace MsiInstallerSample
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            IronSoftware.Logger.LoggingMode = IronSoftware.Logger.LoggingModes.All;
            IronSoftware.Logger.LogFilePath = "Default.log";

            IronBarCode.License.LicenseKey = "IRONBARCODE-MYLICENSE-KEY-1EF01";

            using (OpenFileDialog openFileDialog = new OpenFileDialog())
            {
                openFileDialog.Filter = "Image files (All files (*.*)|*.*";

                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        // Load the selected image
                        using (Bitmap bmp = new Bitmap(openFileDialog.FileName))
                        {
                            // Process the image
                            AnyBitmap anyBitmap = AnyBitmap.FromBitmap(bmp);

                            // Configure barcode reader options (customize as needed)
                            var option = new BarcodeReaderOptions
                            {
                                Speed = ReadingSpeed.Detailed,
                                ExpectMultipleBarcodes = true,
                                ScanMode = BarcodeScanMode.Auto,
                            };

                            BarcodeResults result = IronBarCode.BarcodeReader.Read(anyBitmap, option);

                            if (result.Count > 0)
                            {
                                string output = string.Empty;
                                foreach(var barcode in result)
                                {
                                    Console.WriteLine($"Barcode Found: {barcode.Text}");
                                    output += barcode.Text + "\n";
                                }

                                MessageBox.Show($"Detected Barcodes: \n{output}");
                            }
                            else
                            {
                                MessageBox.Show("No Barcode found.");
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show($"{ex.Message}");
                    }
                }
            }
        }
    }
}
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Adding a Setup Project

After setting up the form and its controller logic, we need to add a Setup Project to the existing solution to create an MSI installer. The Setup Project allows us to build an installer for the application we just created.

Right-click on the solution, then go to Add > New Project...

Add Setup Project

For the MSI installer, build the MsiInstallerSample project again in Release mode. Right-click on the Setup Project, then go to Add > Project Output...

Add project output

To ensure the MSI installer runs smoothly, you must include the following three files in your setup project: onnxruntime.dll, IronBarcodeInterop.dll, and ReaderInterop.dll. These files are generated when you build the project in Release mode:

  • onnxruntime.dll: Located at MsiInstallerSample\MsiInstallerSample\bin\Release
  • IronBarcodeInterop.dll: Located at MsiInstallerSample\MsiInstallerSample\bin\Release\runtimes\win-x86\native
  • ReaderInterop.dll: Located at MsiInstallerSample\MsiInstallerSample\bin\Release\runtimes\win-x86\native

Add additional DLLs

If any of these files is missing, you may encounter the following exception message, as noted in this troubleshooting article: Missing DLLs in Creating MSI Installer

Finally, build the Setup Project. The installer will be located at: MsiInstallerSample\SetupProject\Release

Run & Test the Installer

We install the application with the MSI file to ensure everything is running smoothly.

Demonstration related to Run & Test the Installer

Download MSI Installer Sample Project

You can download the complete code for this guide. It comes as a zipped file that you can open in Visual Studio as a WinFormApp project.

Download the WinForm MSI App Project

Frequently Asked Questions

What is IronBarCode?

IronBarCode is a library that allows developers to read, write, and generate barcodes in .NET applications. It supports a wide range of barcode formats and is designed for easy integration.

How can I create a MSI installer with IronBarCode?

To create a MSI installer with IronBarCode, you need to integrate the IronBarCode library into your application and follow the standard procedures for creating a MSI installer using tools like Visual Studio Installer Projects.

What are the benefits of using IronBarCode in a MSI installer?

Integrating IronBarCode into a MSI installer simplifies the deployment process of applications that require barcode functionality, ensuring that all necessary components are installed correctly on the end-user's system.

Which barcode formats are supported by IronBarCode?

IronBarCode supports a wide range of barcode formats including QR codes, UPC, EAN, Code 39, Code 128, and more, making it versatile for various application needs.

Is it possible to customize barcode appearance with IronBarCode?

Yes, IronBarCode allows customization of barcode appearance, including colors, sizes, and text annotations, to fit the specific design requirements of your application.

Do I need specific tools to integrate IronBarCode into a MSI installer?

You can use common development tools such as Visual Studio to integrate IronBarCode into your application and create a MSI installer. The IronBarCode library is compatible with .NET, making it accessible for developers using this framework.

Can IronBarCode read and write 2D barcodes?

Yes, IronBarCode can read and write both 1D and 2D barcodes, including QR codes, Data Matrix, and others, providing comprehensive barcode functionalities.

What are the system requirements for using IronBarCode?

IronBarCode requires a .NET framework environment to function. It is compatible with .NET Core, .NET 5/6, and earlier versions, ensuring broad compatibility across different projects.

How do I get started with IronBarCode?

To get started with IronBarCode, you can download the library from the Iron Software website, review the documentation, and integrate it into your .NET project following the provided examples and guidelines.

Is technical support available for IronBarCode users?

Yes, Iron Software provides technical support for IronBarCode users, including documentation, tutorials, and direct support options to assist with integration and usage issues.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...Read More

Ready to Get Started?
Nuget Downloads 1,880,638 | Version: 2025.10 just released