\Tips and TricksSize
The section contains tips for keeping down the size of any generated MSIs,
- Duplicated Large Files
If a file exists in more than one place on the destination then
by default its contents will be included multiple times in the MSI.
Have a look at the "DuplicateFile" table.
- Size of Strings
Do not worry too much about the size of the component or other
names as all strings are only stored
once in a Windows Installer "string pool".
If a component name "abc" or "abc...xyz" is used in 1000
places the total difference is still only 23 characters.
Note that only the whole string is pooled, Windows Installer is
not smart enough to pool substrings.
You can use the SDK tool "MsiInfo.Exe" to validate or display
the string pool.
- Size of Fragments of Text
If you have a long string which is part of a number of other strings
(so won't be "pooled") you could create a property with a short name
and use property replacement for all columns that
support "formatted" values.
The size of any branding bitmaps or other graphics or icons will
of course have some effect on the file size.
Its worth spending some time to try to minimise the file size either
by reducing the quality (and/or number of colors) or by playing
around with the graphic options (for example "RLE encoding" can
greatly reduce file size of bitmaps - in general - test all options).
- Shortcut Icons
Never ever use the original program EXE or DLL as the icon source
for shortcuts, extract the needed icons
(see the "Icon Tools" section).
I'd also ensure the extracted icons have as few formats/sizes as
- EXE & DLL in Binary Streams
If you are adding executable binaries
(perhaps using the "Binary" or "DllCa-C" commands)
then you may want to consider using
the free "UPX.EXE"
or similar executable compression tool.
Unlike files, binary resources can't be stored in a compressed format.
- Alternative Compression
If you are really short on space you might be able to add files
to your own "zip", "rar" or other archive and run the decompression
tool as a custom action.
- Export and Re-Import into New MSI
The SDK lists this as an option, not only is this error prone and
dangerous, it is also very difficult and may not process all
Note that the SDK "sample" script will fail if its fullname
contains spaces and that "ORCA" import/export can create bigger
Other people recommend "ORCA" "save as", however this is
crippled and may not save all of the MSI!
- Multiple Save Inefficiencies
Windows Installer can create MSIs with "empty" space if you add
a resource save the MSI and reopen and edit or remove it.
The most likely reason for this would be if you are making
a lot of changes to the initial template.
Normally MAKEMSI uses "uisample.msi" as the template but you
could use "ORCA"" to export its contents and then import the
#define? COMPANY_MSI_TEMPLATE_IDT_DIR <??*MAKEMSI_DIR>Samples\TryMe\Create MSI Installers\ExportedIdt(UISAMPLE.MSI)
;--- Allow user to use another method for getting template data ----------
;--- Start with an Empty MSI ---------------------------------------------
<$Msi "<$ProdInfo.MsiName>.msi" CREATE="Y">
;--- Import the IDT (previously exported all tables with "orca.exe") -----
- Unneeded Tables or Table Contents
Subject to the "Multiple Save Inefficiencies" issue deleting
unneeded rows or tables could potentially save significant space,
- The default "_Validation" table requires about 37K!
MSI and row Validations
need this table.
Default row validation would need changing if the table
didn't exist (to remove the "MISSINGDATA" error messages).
- If you did not want a user interface you could remove a
few large tables as well as any related graphics.
- Compress Whole MSI
I found a commercial tool called
which looks interesting.
Another approach could be to use an archive tool that creates
self extracting EXE (and can execute the file on extraction).
- Any other tips?
Let me know if you have one! Thanks.