Again in April I shared go-cabinet right here, a pure Go library for studying and writing Microsoft Cupboard (.cab) information. LZX was the massive lacking piece on the time, and v0.3.0 provides it for each studying and writing, so go-cabinet now covers None, MSZIP and LZX out of the field.
if err := w.SetCompression(cupboard.LZX); err != nil {
return err
}
The default is a 2 MiB window, and cupboard.LZXWindow(n) picks something from 2^15 to 2^21 bytes. LZX produces noticeably smaller cupboards than MSZIP however compresses extra slowly.
In the event you’re upgrading from v0.2, there are just a few breaking modifications:
- Customized codecs now implement the
EncoderandDecoderinterfaces as a substitute of wrappingio.Authorandio.Reader.mszip.NewWriterandmszip.NewReaderare changed bymszip.NewEncoderandmszip.NewDecoder. MSZipis nowMSZIP.SetCompressionrejects an invalid or unregistered methodology instantly as a substitute ofShutfailing later.
Full launch notes: Launch v0.3.0 · abemedia/go-cabinet · GitHub
As earlier than, I’d love to listen to from anybody utilizing it, and particularly about any cab information it might probably’t deal with.
Good to see LZX land. One factor price testing earlier than calling it achieved: real-world LZX cupboards from previous installers typically have a number of folders, non-default window sizes and information whose CFDATA is break up throughout many blocks, and that structure is the place most decoders break first. Do you might have round-trip exams towards cabextract or 7-Zip output for these instances, or is protection principally single-folder archives written by the library itself? If you’d like awkward samples, self-extracting installers from the 2000s are an excellent supply of wierd block sizes.
Thanks for the tip! I did check with a bunch of real-world information, however none that previous. Not one of the check fixtures are generated by the library itself, however are all created with makecab.

