Wednesday, February 22, 2012

How to make an MSI with some files compressed in Cabinet file and other uncompressed outside the MSI

This is a very interesting feature in MSI and I would like to explore and explain this for your knowledge and benefit.

Word Count generally known as Word Count Summary property. This is a mandatory Summary property in MSI and can be changed from your WSI. Please note that this property is not in Property table but is in Summary table.
This property has a different meaning for MSI, Transforms and Patch.
This property is a bit feild.
There are 4 bits which can be set or unset as in 0 or 1. eg. 01
Here is the description for these bits:
---------------------------------------------------------------------------------
Bit 0
0 Long file names.
1 Short file names.

---------------------------------------------------------------------------------
Bit 1
0 Source is uncompressed.
2 Source is compressed.

---------------------------------------------------------------------------------
Bit 2
0 Source is original media.
4 Source is a administrative image created by an administrative installation.
---------------------------------------------------------------------------------
Bit 3
0 Elevated privileges can be required to install this package.
8 Elevated privileges are not required to install this package.

Available starting with Windows Installer version 4.0 and Windows Vista or
Windows Server 2008.
---------------------------------------------------------------------------------

Here is what you get when you combine these values:

Value=0
means Original source is using long file names. Matches tree in Directory
Table. Elevated privileges can be required to install this package.

Value=1 means Original source is using short file names. The file structure
Matches tree in Directory Table. Elevated privileges can be required to install
this package.

Value=2 means Compressed source files using long file names. Matches cabinets and
files in the Media Table. Elevated privileges can be required to install this
package.

Value=3 means Compressed source files using short file names. Matches cabinets
and files in the Media Table. Elevated privileges can be required to install this
package.

Value=4 means you are installing an Administrative image using long file names.
Matches tree in Directory Table. Elevated privileges can be required to install
this package.

Value=5 means you are installing an Administrative image using short file names.
Matches tree in Directory Table. Elevated privileges can be required to install
this package.

Value=8
means Elevated privileges are not required to install this package. Use
this value when Authoring Packages without the UAC Dialog Box.
Available starting with Windows Installer version 4.0 and Windows Vista or
Windows Server 2008.

Now if you set the Bit 1 which means that the package is marked as compressed,
the Windows Installer only installs files located at the root of the source and
not in the tree like directory structure. In this case even the files marked as
Uncompressed in the File table must be located at the root of the source
directory of your MSI so that they can be installed.
Now to make a package that has both a cab file (compressed files) and
uncompressed files that match the tree in Directory table, you need to mark the
package as uncompressed by leaving bit 1 unset, that is a value of 0 in the Word
Count Summary Property and then you need to set the File Attribute to compressed
file (value of 16384 to be added to the current value of file attribute) in the
attribute column of file table for each file which is in Cabinet file.

Transforms:

In Transform you should not try and experiment with this property because in
Transforms this property should be always Null.
Patches:
In Patches the value of this property determines the minimum Windows Installer
version required to install the patch.
Value=1 which is the default value, means that MSPATCH was used to create the
Patch
Value=2 means a minimum version of Windows Installer 1.2 is required for patch to
be applied.
Value=3 means a minimum version of Windows Installer 2.0 is required for patch to
be applied.
Value=4 means a minimum version of Windows Installer 3.0 is required for patch to
be applied.
Value=5 means a minimum version of Windows Installer 3.1 is required for patch to
be applied.

Hope this new information will be helpful to you in designing your MSI in a
better way