Tuesday, May 23, 2006

The merge module and WiX

We've discovered some difficulties combining the merge module distributed in the SDK with MSI packages built with the WiX installer system. The symptoms typically manifest themselves as a failure for the SDK components to be registered.

The cause of this error is twofold. One, WiX is aggressive in pruning tables and actions from the final MSI package that it feels are unneeded. Two, the merge module expects certain actions and tables to be in place without explicitly specifying them. I believe WiX is acting correctly and its aggressive pruning is merely exposing a pre-existing problem. As such, all future merge modules after 2.11.2 will have the necessary information added.

In the interim, the following is an example of how to work around the problem and ensure all the necessary actions and tables are included by the WiX build system.


<?xml version="1.0" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2003/01/wi">
<Product Id="PUT-GUID-HERE" Name="Foo Test Package" Language="1033" Version="1.0.0.0" Manufacturer="Plantronics Inc.">
<Package Id="????????-????-????-????-????????????" Description="The Foo Installer package" InstallerVersion="200" Compressed="yes" />

<Media Id="1" Cabinet="foo.cab" EmbedCab="yes" />

<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Id="FooDir" Name="FooProg" LongName="Foo Program">

<Component Id="FooComponent" Guid="PUT-GUID-HERE">
<File Id="FooFile" Name="Foo.txt" DiskId="1" Source="foo.txt" />
</Component>

<Merge Id="PlantronicsDevice" Language="1033" SourceFile="Plantronics Device.msm" DiskId="1" />

</Directory>
</Directory>
</Directory>

<Feature Id="Foo_Feature" Title="The Foo Feature" Level="1">
<ComponentRef Id="FooComponent" />
<MergeRef Id="PlantronicsDevice" />
</Feature>

<EnsureTable Id="Extension"/>

<InstallUISequence>
<ResolveSource After="CostInitialize" />
</InstallUISequence>

<InstallExecuteSequence>
<UnregisterTypeLibraries Sequence="2300" />
<RemoveRegistryValues Sequence="2600" />
<UnregisterClassInfo Sequence="2700" />
<UnregisterExtensionInfo Sequence="2800" />
<UnregisterProgIdInfo Sequence="2900" />
<UnregisterMIMEInfo Sequence="3000" />
<RegisterClassInfo Sequence="4600" />
<RegisterExtensionInfo Sequence="4700" />
<RegisterProgIdInfo Sequence="4800" />
<RegisterMIMEInfo Sequence="4900" />
<WriteRegistryValues Sequence="5000" />
<RegisterTypeLibraries Sequence="5500" />
</InstallExecuteSequence>
</Product>
</Wix>


For those interested, WiX is available as an open source project on SourceForge (here)

0 Comments:

Post a Comment

<< Home