3 ms·
The preferred solution seems to be WiX, which was created by some of the people behind MSI and generates the MSI database from an XML description. Unfortunatel
by ptx 6y ago
The preferred solution seems to be WiX, which was created by some of the people behind MSI and generates the MSI database from an XML description.
Unfortunately it requires you to write (or copy from somewhere) literally thousands of lines of incomprehensible XML. You have to learn all the details of both MSI and the various novel sublanguages embedded in the WiX XML.
But fortunately you can generate all the XML from just a few lines of nice and clean C# using WiX#, which adds a user-friendly API on top of WiX and lets you forget about XML and databases entirely:
https://github.com/oleg-shilo/wixsharp https://github.com/oleg-shilo/wixsharp
- EvanAnderson 6y agoThe perspectives in the comments on this article re: WiX XML source and Windows Installer being difficult are interesting to me. Like I said elsewhere, I overcame that learning curve so long ago that I can't put myself in a position where it seems daunting now. To be fair, though, an MSI to install a 10 files in "C:\Program Files\AppName", register a couple .NET assemblies, create a couple of shortcuts, and throw a few values into the registry would amount to <100 lines of XML. Here's a years-old WiX 2.0 syntax source file to install 4 files in "C:\Program Files\appname" and run an EXE embedded in the MSI to install a service: https://github.com/EvanAnderson/ts_block/blob/master/MSI/ts_block.wxs https://github.com/EvanAnderson/ts_block/blob/master/MSI/ts_... I've only seen "thousands of lines" of WiX source when dealing programs that install a ton of files, or put scads of entries in the registry. Most of the MSIs with WiX are based on a simple skeleton generated from a template, and using "includes" generated by the "candle" tool. Understanding the Windows Installer and the WiX source feels analogous to what I see in "modern" web development-- a bunch of tools that developers use, seemingly without understanding what they do, to create a massive pile of edifice into which original code is finally placed.