WiX.Py: we assemble MSI package “in three lines”

No time and no desire to learn kilometer WiX files to build an MSI installer for your project, while plunging into the depths of MSDN? Want to build an installer, describing it in simple and understandable terms, in a few lines? Is there a clinical propensity for cross-platform and Linux & Docker builds? Well then to you under kat!

Developers unwittingly

As a matter of fact, it was with these "Wishlist" that our project of a cross-platform vector graphics editor came across a couple of months ago.

We knew about the WiX Toolset (Windows Installer XML), but even a cursory viewing of tutorials on the official website brought sadness and gloom - without serious immersion in the XML description of the installers is necessary. Used more simple MakeMsi, but in it there was a mass of defects. And again, all these tools were not suitable for building MSI under Linux.

The search led to the wixl project , which compiled MSI on Linux, but suffered a serious flaw in terms of functionality and required monstrously sized XML files as WiX.

As a result, in order to acquire the necessary tool for the assembly, we reimplement the wixl logic in python, correcting many shortcomings and adding the necessary functionality, and made the project cross-platform. This is how WIX.Py appeared - an MSI collector with a very low threshold of entry.

How WiX.Py works

The process of creating an MSI package is simplified to the limit:

  1. In an arbitrary folder (for example build) we create the contents for installation in the form in which it will be on the target computer.

  2. Fill in a small JSON file. For example:

    "Name": "MyApp",
    "UpgradeCode": "3AC4B4FF-10C4-4B8F-81AD-BAC3238BF690",
    "Version": "0.1",
    "Manufacturer": "My Company",
    "Description": "MyApp 0.1 Installer",
    "Comments": "Licensed under GPLv3+",
    "Keywords": "wxs, xml, build",
    "Win64": true,
    "_CheckX64": true,
    "_AppIcon": "resources/myapp.ico",
    "_ProgramMenuFolder": "My Company",
    "_Shortcuts": [
        {"Name": "MyApp",
        "Description": "MyApplication",
        "Target": "myapp.exe",
        "AddOnDesktop": true,
        "OpenWith": [".xml", ".wxs", ".yml"]
    "_SourceDir": "build/",
    "_InstallDir": "myapp-0.1",
    "_OutputName": "myapp-0.1_win64.msi",
    "_OutputDir": "./"

  3. We generate the MSI package with the command:

    wix.py <имя_файла>.json

Yes, this is a fully working example of an MSI package that checks before installation that Windows 64bit, installs the application in Program Files, adds the application to the software menu and to the desktop, and links the specified file formats to the application to be installed. No magic and shamanism with the register.

It is possible to further reduce the example to 5-6 lines, but then the installer's functionality will be quite short.

Using WiX.Py, MSI can be assembled both in Windows and Linux, incl. in docker containers. Since basic libmsi can be compiled on many other UNIX systems (for example, macOS), WiX.Py can formally be used on them, it does not carry any practical sense.

A description of the various nuances can be found in the project documentation .


If WiX.Py is right for you to solve problems in creating MSI packages, but you don’t have any functionality, go to our website https://wix.sk1project.net and create a request to expand the functionality. The same goes for detected bugs - report and we will deal with them. In the same place on the website you will find the source code and ready packages for different platforms.

If there is a desire to compare with WiX, then on Habré there were more than once articles on WiX: 1 , 2 , 3 , 4 .

Also popular now: