RFC: reducing wasted disk space from addon files

Erich E. Hoover erich.e.hoover at gmail.com
Wed Mar 6 15:32:13 CST 2019


> On Wed, Mar 6, 2019 at 9:37 AM Vincent Povirk <vincent at codeweavers.com> wrote:
> ..
> Nope, but MSI has absolutely no capability for "recursively" unpacking
> directories.  You must enumerate absolutely every single individual
> file you want from the cabinet - no exceptions.  I have scripts that I
> use to do this that take the complete contents of a structured cabinet
> file and automatically create all the appropriate "Feature" and
> "Component" entries for each file and directory in order to ensure
> that the installer recreates the structure of the cabinet file.  I
> personally find this to be incredibly useful for distributing
> installers with a lot of structure in them.

I decided to cobble together an example, so I've created a small
installer package:
https://www.dropbox.com/s/jw8wx9erhe3ojjn/test.msi?dl=1
and a structured cabinet file*:
https://www.dropbox.com/s/ext42acee3ei0vm/data.cab?dl=1

I highly recommend using a separate prefix for testing, but you can
install this one of two ways:
1) "regularly" running it:
wine msiexec /i test.msi
2) passing it an "already installed here" path:
INSTALLFOLDER="C:\\" wine msiexec /i test.msi

This installer demos three features:
1) installing from a cabinet file outside the MSI file (drop the pound
sign in the Media table)
2) unpacking a structured cabinet file (mono-test/test.txt will be
installed to C:\windows\mono\mono-test\test.txt)
3) using an environment variable to conditionally install a feature,
and all sub-features and components (note that if INSTALLFOLDER is set
that data.cab does not need to exist)

Presumably in the end you would pass an INSTALLFOLDER of something
like "\\\\?\\unix\\usr\\share\\wine\\mono\\4.8.0\\" and then store
this value in the registry.

Hopefully this is helpful.  I took a quick look at the mono tarball
and, since you're constructing the MSI manually, it looked like this
wouldn't be too terrible to add if you wish to approach it this way.
If you're going to do something like this I would suggest starting
with using paths in the cabinet file first (with it still inside the
MSI file), then setting up conditional install, then doing the cabinet
file externally last.  You might also wish to change how you generate
the component UUIDs so that you don't have to keep track of them
anymore:
uuid -v 5 ns:URL "file://${UNIXFILE}" | tr '[a-z]' '[A-Z]'

Best,
Erich

*I use lcab (lcab mono-test/test.txt data.cab), but presumably other
tools work just as well



More information about the wine-devel mailing list