I was recently asked a question by a customer who was building an MSI using WiX v3.0 and the Votive add-in for Visual Studio 2005. They were trying to consume the VC 8.0 runtime merge modules (MSMs) into their MSI, but were having trouble figuring out exactly how to configure their WiX project so that it would correctly consume these MSMs and install the VC 8.0 runtime files as part of their MSI-based setup.
I looked around a little bit and found these instructions written by Nikola Dudar on the Visual C++ team here at Microsoft. However, the instructions in that blog post are based on WiX v2.0, and the equivalent steps in WiX v3.0 are much more straightforward, so I decided to post a set of steps that can be used to create an MSI in WiX v3.0 and Votive that consumes the VC 8.0 runtime MSMs:
- Install Visual Studio 2005 Standard Edition or higher
- Download and install the latest build of WiX 3.0 from http://wix.sourceforge.net/downloadv3.html. You need to install the ProjectAggregator2 MSI and then the WiX 3.0 MSI
- Launch Visual Studio 2005
- Choose File | New | Project…
- In the New Project dialog, select the WiX project type and then the WiX Project template to create a new WiX project
- In the WXS file that is created as part of the new project, add new <Merge> elements as children of the TARGETDIR <Directory> element for each one of the VC 8.0 runtime merge modules that you want to include in your MSI. For example, to include MSVCRT, use the following items:
<Merge Id=”CRT” Language=”0″ SourceFile=”c:\Program Files\Common Files\Merge Modules\microsoft_vc80_crt_x86.msm” DiskId=”1″ />
Note: You will need to change the SourceFile attributes to point to the exact locations of the MSM file on your system. This location depends on what partition you have your OS installed to.
- For each <Merge> element that you addded in step 6, add a <MergeRef> element under the appropriate <Feature> element. For example:
<MergeRef Id=”CRT” />
- Add any other information that you want to include in your MSI, save the project and build it using Visual Studio
When building an MSI that consumes the VC 8.0 runtime MSMs using Votive v3.0 in Visual Studio 2005, you may see several of the following types of warnings in your build output:
- WixProject1.wxs(10,0): Warning LGHT1055: The InstallExecuteSequence table contains an action ‘SxsInstallCA’ which cannot be merged from the merge module ‘c:\Program Files\Common Files\Merge Modules\policy_8_0_Microsoft_VC80_ATL_x86.msm’. This action is likely colliding with an action in the database that is being created. The colliding action may have been authored in the database or merged in from another merge module. If this is a standard action, it is likely colliding due to a difference in the condition for the action in the database and merge module. If this is a custom action, it should only be declared in the database or one merge module.
- light.exe(0,0): Warning LGHT1076: ICE03: String overflow (greater than length permitted in column); Table: Component, Column: KeyPath, Key(s): downlevel_manifest.8.0.50727.762.98CB24AD_52FB_DB5F_FF1F_C8B3B9A1E18E
- light.exe(0,0): Warning LGHT1076: ICE30: The target file ‘ansiatl.dll|ATL80.dll’ might be installed in ‘[SystemFolder]’ by two different conditionalized components on an LFN system: ‘ansi_atl80.97F81AF1_0E47_DC99_FF1F_C8B3B9A1E18E’ and ‘nosxs.97F81AF1_0E47_DC99_FF1F_C8B3B9A1E18E’. If the conditions are not mutually exclusive, this will break the component reference counting system.
- light.exe(0,0): Warning LGHT1076: ICE82: This action SystemFolder.97F81AF1_0E47_DC99_FF1F_C8B3B9A1E18E has duplicate sequence number 6 in the table InstallExecuteSequence
- light.exe(0,0): Warning LGHT1076: ICE83: The keypath for Global Win32 SXS Assembly (Component_=uplevel.66332652_9C28_58B1_FF1F_C8B3B9A1E18E) SHOULD NOT be it’s manifest file for assemblies other than Win32 Policy assemblies
The first type of warning indicates that actions with the same name exist in multiple merge modules. Windows Installer requires unique action names, and when attempting to merge MSMs that contain multiple actions with the same name, Windows Installer will exclude all but the first action. In this case, the exact same SxsInstallCA and SxsUninstallCA actions exist in all of the VC 8.0 runtime MSMs, and so all but the first ones are excluded from the merging process. However, all of these actions are identical and execute the same code behind the scenes, so it is safe to ignore this type of warning because you will not be losing any required functionality during the merge process.
The second type of warning indicates that some identifiers are longer than the maximum values specified in the _Validation table of the MSI. The documentation for ICE03 indicates that Windows Installer does not internally limit the column width to the specified value, so these warnings can be safely ignored.
The third type of warning helps prevent authoring different components that install the same files to the same destination folder (which would violate Windows Installer component rules). However, in the case of these VC 8.0 MSMs, the components have conditions that are mutually exclusive (Version9x and VersionNT < 501) so the component rules will not be violated and these warnings can be safely ignored.
The fourth type of warning indicates that actions contain duplicate sequence numbers in the InstallExecuteSequence table. When actions have duplicate sequence numbers, there is no guarantee about what order they will be run in. However, in this case, the actions have no order dependencies and it is safe to ignore these warnings as well.
The fifth type of warning helps prevent authoring incorrect keypath files for Win32 global assemblies that are installed to the WinSxS component store. This warning indicates that they keypath should not be a manifest file unless the assembly is a Win32 policy assembly. In this case, the assembly is a Win32 policy assembly, so these warnings can also be safely ignored.
Note: it is possible to suppress the above warnings by configuring some settings in the WiX linker project property page in Visual Studio. In general, however, I advise against doing that because if you enable suppressions, you might end up missing other warnings or errors in the same categories that are not safe to ignore.
<update date=”2/12/2008″> Added information about ICE03 warnings that can occur when merging the VC 8.0 MSMs that I missed when I originally wrote this post. </update>
<update date=”2/11/2009″> Removed references to policy MSMs because the general recommendation is to not include policy MSMs when redistributing the VC runtime files. </update>