Mastering MSI Creation: A Step-by-Step Guide Using WiX Toolset

Mastering MSI Creation: A Step-by-Step Guide Using WiX Toolset

Donald Lv12

Mastering MSI Creation: A Step-by-Step Guide Using WiX Toolset

Versus

Inno SetupInno SetupWiX ToolsetWiX ToolsetInstallShieldInstallShieldMSIX Packaging ToolMSIX Packaging Tool

icon subscribe mail

Check your inbox and confirm the
subscription

Exclusive NewsletterExclusive Newsletter

Exclusive NewsletterExclusive Newsletter

Get the latest WiX insights direct to your inbox. Subscribe now!

Disclaimer: This post includes affiliate links

If you click on a link and make a purchase, I may receive a commission at no extra cost to you.

How to create an MSI installer with WiX

Written by Renato Ivanescu · June 20th, 2023

The MSI format is a widely recognized standard in the software industry for distributing software packages to Windows-based devices. MSI packages offer numerous advantages over alternative software installation methods, including enhanced reliability and improved performance.

WiX is an open-source toolset to build MSI packages. It enables developers to create a software installation by writing XML that describes components, registry entries, and other resources.

In this article, I’ll show you how to use WiX to create an MSI installer for a Windows Forms application. Let’s dive in!

https://techidaily.com

Add the setup project to your application

Once you have created the Windows Forms application, the next step is to add the setup package to it.

  1. Right-click on the project solutionAddNew project.
  2. From the project list, choose Setup Project for WiX. You will find this template only if you have the Wix Toolset Visual Studio Extension installed. Need help installing it? We’ve got you – check out this tutorial.

Setup Project for WiX

https://techidaily.com

After creating the setup project, you should see it in _Solution Explore_r. The Product.wxs file is the one containing the setup project logic.

Solution Explorer - Product.wxs

https://techidaily.com

Add project output to your setup project

Next, we need to include the deployable files in the setup project. To achieve this, we can use the Wix Setup Editor.

NoteWix Setup Editor is an interactive GUI used to manage the setup files. It is available only if you have the Wax extension installed. If you want to see how to add the extension, you can also read this article.

To open the editor, go to ToolsWiX Setup Editor. Here we have to make some configurations:

  • Select the setup project in the ‘Setup project to edit’ section. In our case, it is AppSetup.
  • For the ‘Root directory’, select INSTALLFOLDER.
  • In the ‘Projects to install section’, select your Window Forms application. We selected MyApp, as this is our application.

Wix Setup Editor

Make sure the files have the resolved state like in the image above. If they have the unmapped state as shown below, update it to resolved by pressing the ‘+’ button under the warning sign.

Add project output to your setup project

https://techidaily.com

How to edit product details

To modify the product details, navigate to the Product.wxs file and make the necessary edits to the relevant fields. For example, we set the version to 1.2 and the manufacturer to Caphyon.

Copy

https://techidaily.com

How to create Shortcuts for your application?

In order to create a shortcut, we will need to make edits to the XML file since the Wix Setup Editor does not provide direct shortcut creation functionality.

Follow the next steps to add a shortcut on the Desktop and one in the Programs Menu:

1. Define the directory structures.

Copy

2. Add the shortcuts to the installer package.

Copy

3. Tell Windows to install the shortcuts.

<Product Id=”*” ….>

….



Copy

How to add installation dialogues?

By default, when you create an installer package using WiX, it does not include a user interface (UI). However, if you wish to incorporate a minimal UI, you can follow the steps outlined below:

1. Right-click in the setup projectAdd → _Reference_s. In the Add Reference dialog, look in the bin folder of the Wix toolset and add WinUiExtension.dll.

add installation dialogues

2. Go to the Product.wsx file and add the next line inside the <Product> element to reference the UI:

Copy

How to install your application?

Now, you can build the setup project.

  1. Go to the bin folder inside the setup project folder to find the MSI file.
  2. Run the file and install the application.
  3. After the installation, you should find the shortcuts on the Program Menu and Desktop.

install your application

Conclusion

WiX toolset is a flexible tool for creating installer packages but when it comes to more complex packaging scenarios, it may require additional time and effort. The WiX Setup Editor offers limited functionalities, and you will often need to manually edit the XML file to configure most settings.

Alternatively, you can explore a GUI-based tool like Advanced Installer to create and manage installation packages. It has a user-friendly interface and is much easier to use. It provides a range of pre-built templates which simplify the process of creating MSIs.

You can watch the tutorial below to see how easy it is to create an MSI with Advanced Installer.

Advanced Installer #1 alternative to the WiX Toolset

We decided to focus on our main goal to save precious time of our developers.

HANS-LEO TEULINGS
PHD – CEO, NEUROSCRIPT, LLC

You might find useful:

Get the most from packaging with Advanced Installer

Try the 30-day fully-featured edition absolutely free!

Download Free Trial

No credit card required

Also read:

  • Title: Mastering MSI Creation: A Step-by-Step Guide Using WiX Toolset
  • Author: Donald
  • Created at : 2024-10-02 18:42:01
  • Updated at : 2024-10-03 20:16:30
  • Link: https://some-tips.techidaily.com/mastering-msi-creation-a-step-by-step-guide-using-wix-toolset/
  • License: This work is licensed under CC BY-NC-SA 4.0.