No time and no desire to learn kilometer WiX files to build an MSI installer for your project while plunging into the abysses of MSDN? Want to build the 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!
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 indispensable. 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 the same XML files of monstrous proportions 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.
The process of creating an MSI package is simplified to the limit:
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.
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": "./" }
We generate the MSI package with the command:
wix.py <_>.json
Yes, this is a fully working example of the MSI package, which will check before installation that Windows 64bit, install the application in Program Files
, add the application to the program menu and to the desktop, and link 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 the base libmsi can be compiled on many other UNIX systems (for example, macOS), formally WiX.Py can 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 for expanding the functionality. The same goes for detected bugs - report and we will deal with them. In the same place on the site 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 .
Source: https://habr.com/ru/post/424091/
All Articles