Page 1 of 1

Shrinking the Installer

PostPosted: Mar 18, 2003 @ 9:34pm
by Presto
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

PostPosted: Mar 18, 2003 @ 9:42pm
by fzammetti
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...

PostPosted: Mar 19, 2003 @ 8:58pm
by Sm!rk

PostPosted: Mar 19, 2003 @ 9:29pm
by fzammetti

PostPosted: Mar 19, 2003 @ 9:38pm
by Presto

PostPosted: Mar 19, 2003 @ 9:51pm
by fzammetti