3 ms·
As someone who dabbles in Windows desktop development, I still don't know the best way to even make an MSI. Some of the tools from Microsoft are usable but the
by wvenable 6y ago
As someone who dabbles in Windows desktop development, I still don't know the best way to even make an MSI. Some of the tools from Microsoft are usable but they all seem to be obsolete.
- EvanAnderson 6y agoThe WiX toolset[1] is what I use. I've never used the Visual Studio extensions for WiX. I do everything with a plain ol' text editor. [1] https://wixtoolset.org/ https://wixtoolset.org/
- for_xyz 6y agoIf you start from scratch, I'd suggest to use MSIX [0] instead. It makes auto update trivial to implement with PackageManager.UpdatePackage(url_to_your_msix)[1] or plain execute via "ms-appinstaller:?source=url_to_your_msix". It'll do diffs properly and you also get package reflection for free via WinRT apis (such as where app is installed, appdata location, app version, etc). [0] https://docs.microsoft.com/en-us/windows/msix/overview https://docs.microsoft.com/en-us/windows/msix/overview [1] https://docs.microsoft.com/en-us/uwp/api/windows.management.deployment.packagemanager.updatepackageasync?view=winrt-19041 https://docs.microsoft.com/en-us/uwp/api/windows.management....
- wvenable 6y agoAssuming I'm not building a UWP app, how do I build an MSIX. The only thing I found was the MSIX packaging tool and the description is this: "You can run your desktop application installers through this tool and obtain an MSIX package that you can install on your machine or upload to the Microsoft Store. " Gross.
- EvanAnderson 6y agoI need to look into MSIX. MSI has been handling my needs for awhile now but I hear MSIX is really nice. Thanks for the nudge to look in that direction.
- ptx 6y agoThe 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.