PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Shrinking the Installer

Here's the deal:
I've compiled my code for ARM, MIPS and SH3. Each executable is about 400KB.
I've got about 1MB of supporting files (sounds and graphics) which are common to all installations.
I want to make one installer that works for all 3 platforms. Even uncompressed, (which it wouldn't be), the setup.exe would be a maximum of 2.2MB.

But what I tried didn't quite work that way.
Using the standard installation instructions, my program's .inf file looked kinda like this:

[CEDevice]
ProcessorType = 0
[CEDevice.ARM] (repeat for MIPS and SH3)
ProcessorType = 2577

[SourceDiskNames]
1 = ,"Common files",,"C:\BLAH\COMMON"
[SourceDiskNames.ARM] (repeat for MIPS and SH3)
2 = ,"Exe files",,"C:\BLAH\ARM"

And then: cabwiz.exe blah.inf /cpu ARM MIPS SH3

I end up with three cab files:
program.ARM.cab
program.MIPS.cab
program.SH3.cab

And as you can guess, all of the common files are stored in each of the cab files. So each one is about 1.2MB, and when put into a single setup.exe using EZSetup, the installer is about 2.8MB. (due to compression)

Since that wasn't the result I wanted, I made two .inf files: one for the cpu types and one for the common files. This way I came up with four .cab files:
programCommon.cab
programCPU.ARM.cab
programCPU.MIPS.cab
programCPU.SH3.cab

When combined using EZSetup, the setup.exe file was about 1.5MB. Bingo! That's how big it should be.

However...

When I tried installing it, only the ARM files were copied. None of the common image/music files made it onto the device, even though they were set to install for a processortype of 0 (everything).

Anyone have experience with this? A 1.5MB download is more attractive than a 3MB download. And it seems a complete waste to have three copies of the common files stored in the installer. (I hate wasting space like that.) I'd rather make three installers (one for each CPU type) than do that, but that's not customer-friendly.

Is there a limitation in EZSetup that only lets it install one .cab file? Shouldn't it install all CABs which meet the processortype setting? Does the first part of the .cab file names all have to match?

Thanks,
-John
Please keep in mind that what I'm about to say might be COMPLETELY wrong, or invalid if using EZSetup, but here goes...

Any PPC installer to the best of my knowledge works by copying a CAB file to the device and executing it. This to me means that you probably can't transfer multiple CAB files at once, you would probably have to copy each one over, execute it, rinse and repeat.

If you are writing your own installer, or if you want to modify EZSetup, one approach is to NOT create the CAB files... instead, include in your distribution all the files that would go into your CAB files, including your common files. Then, behind the scenes of your installer, execute CABWIZ and create the CAB file on-the-fly that includes all your common files as well as the platform-specific files, then just do the normal copy and execute step with that. Obviously you need to include the INI and INF files as required, or you could write them out from your installer if you didn't want them separate.

I'm interested to know if anyone else has a solution because I could see this coming up for many people...
fzammetti wrote:
I'm interested to know if anyone else has a solution because I could see this coming up for many people...


Not really, I would just make a separate version for ARM which will be even smaller than 1.5M. Then perhaps bundle the MIPS and SH3 into one package without caring about the size. Now admittedly that may upset the <5% who own the devices, but you are making far more people happy who have an ARM chip. I don't have any real numbers on this, but the writing is on the wall, so to speak, since you have to go out of your way to buy a MIPS or SH3 pda.
There are quite a few people still using MIPS and SH3 devices (myself included). I dare say the percentage isn't as low as 5%.

The question the becomes: what percentage is low enough to not care about? Is pissing off 25% of the people OK? How about 15%? 10%? 5%?

There must be a better solution than to knowingly piss off ANYONE.
Is it really that extreme? I didn't know 90%+ of the devices out there used ARM processors. If that's the case, I'll make them separate.

Since my original post, I've tried a ton more variations on making a single installer. It appears that EZSetup tries for a matching CPU first, and if it can't find it, then it installs the default. In either case, it'll only install one .cab file. (I'd have to check the source to be sure.) Frank's idea is on the right track... except it wouldn't work on Win9x systems, just NT, since EZSetup doesn't run on Win9x.

You win some, you lose some. Thanks for the feedback.

-John
That's good to know, thanks Presto.

I think my suggestion would work if not using EZSetup in case anyone else has similar issues... I may in fact wind up doing that for my next game release since I'll probably run into a similar set of circumstances. But I wrote my own installer, so I can play those games easy enough.

Thanks for the info!