[mojosetup] XZ problems with MojoSetup

Ryan C. Gordon icculus at icculus.org
Mon Jan 24 02:27:29 EST 2011

> Any ideas what i did wrong? (xz cuts my installer by 100MB over zip)

.zip files work because they have a field at the end of their data that 
reports where it starts (so you can just append it to an exe, and the 
exe can figure out where the .zip file starts in the middle of the .exe 
file based on this information).

Tar and .xz have no such information (Tar, at least, was meant to be 
appended to with new data, so the only way you know you're done is if 
you hit EOF).

I'm currently adding functionality so MojoSetup can use an arbitrary 
non-ZIP archive for self-extracting, but you won't ever want to use a 
tar.xz for this, since there's no random file access it in (it has to 
decompress the whole thing just to know what files are available).

Your best bet in the short term would be to put your game data in a 
tar.xz, which MojoSetup will extract during the install, and then zip 
everything up (various zip utilities should be smart enough to compress 
the GUI plugins, etc, and not try to compress the .xz file further) for 
appending to the .exe. This way, MojoSetup gets fast access to the files 
it needs, the .xz uncompresses once during the install, and everything 
gets optimal compression.

The clean, elegant solution is to wait for me to write the 7zip support 
(which removes the need for using _any_ tar.xz or .zip files), but 
that's not happening this week.


More information about the mojosetup mailing list