We have to define $WIX in any case for libpreload, so we might as well
get our money's worth out of it and not also require the Wix directory
to be on PATH.
lcab produces uncompressed CAB files, which is a bit low-quality for
my taste - especially when it turns out CAB files have Deflate as one
of their compression options, so I can write a compressed CAB-builder
in only about 100 lines of Python using the zlib module! I'd expected
to have to faff about finding an implementation of LZX, but there's
really no need to bother.
In my test MSI, the files are supposed to be in alphabetical order,
not in 'whatever order lcab enumerated the Unix directory I pointed it
at' order. The test MSI didn't install, but with this change, it does,
so my guess is that either the real Windows installer system depends
on the alphabetical order for a search algorithm, or else files in the
cab are referred to by a numeric index of some kind.
If I compile this to Linux native code, and then run WiX under Mono,
it loads this library and gets past the first CabExtract call, so I
can find out what the next problem turns out to be.