views:

42

answers:

3

I have created a WiX installation package for a large program. The install package includes the merge modules for the Visual C++ 9.0 files. I need to include the merge modules for a COM DLL. The installation runs just fine. The first time I run the program, though, something odd happens. The first time the COM DLL is called, the Windows install mechanism starts running. An installation dialog pops up out of the blue. It does whatever it needs to do for a little while, then it goes away and the program resumes its normal function. This only happens the very first first time the COM DLL that needs the Visual C++ merge modules, and once the installer is done the program continues running without incident. Why is this happening, and what can I do to prevent it? Here is the WiX code for the merge modules:

<DirectoryRef Id="TARGETDIR">
  <Merge Id="VCRedistCRT" SourceFile="C:\Program Files\Common Files\Merge Modules\Microsoft_VC90_CRT_x86.msm" DiskId="1" Language="0"/>
  <Merge Id="VCRedistATL" SourceFile="C:\Program Files\Common Files\Merge Modules\Microsoft_VC90_ATL_x86.msm" DiskId="1" Language="0"/>
  <Merge Id="VCRedistMFC" SourceFile="C:\Program Files\Common Files\Merge Modules\Microsoft_VC90_MFC_x86.msm" DiskId="1" Language="0"/>
  <Merge Id="VCRedistMFCLOC" SourceFile="C:\Program Files\Common Files\Merge Modules\Microsoft_VC90_MFCLOC_x86.msm" DiskId="1" Language="0"/>
  <Merge Id="VCRedistOpenMP" SourceFile="C:\Program Files\Common Files\Merge Modules\Microsoft_VC90_OpenMP_x86.msm" DiskId="1" Language="0"/>
</DirectoryRef>

<Feature Id="VCRedistCRT" Title="Visual C++ 9.0 CRT Runtime" AllowAdvertise="no" Display="hidden" Level="1">
  <MergeRef Id="VCRedistCRT"/>
</Feature>
<Feature Id="VCRedistATL" Title="Visual C++ 9.0 ATL Runtime" AllowAdvertise="no" Display="hidden" Level="1">
  <MergeRef Id="VCRedistATL"/>
</Feature>
<Feature Id="VCRedistMFC" Title="Visual C++ 9.0 MFC Runtime" AllowAdvertise="no" Display="hidden" Level="1">
  <MergeRef Id="VCRedistMFC"/>
</Feature>
<Feature Id="VCRedistMFCLOC" Title="Visual C++ 9.0 MFC LOC Runtime" AllowAdvertise="no" Display="hidden" Level="1">
  <MergeRef Id="VCRedistMFCLOC"/>
</Feature>
<Feature Id="VCRedistOpenMP" Title="Visual C++ 9.0 Open MP Runtime" AllowAdvertise="no" Display="hidden" Level="1">
  <MergeRef Id="VCRedistOpenMP"/>
</Feature>

If I had to guess, it looks like the Visual C++ libraries are being installed "on first use;" that is, the feature is not fully installed until someone uses it. I would think that would be impossible as the AllowAdvertise valuue is set to "no," but I'm not a WiX expert.

A: 

You also have to install the policy merge modules:

C:\Program Files\Common Files\Merge Modules\policy_9_0_Microsoft_VC90_ATL_x86.msm
C:\Program Files\Common Files\Merge Modules\policy_9_0_Microsoft_VC90_CRT_x86.msm
C:\Program Files\Common Files\Merge Modules\policy_9_0_Microsoft_VC90_MFC_x86.msm
C:\Program Files\Common Files\Merge Modules\policy_9_0_Microsoft_VC90_MFCLOC_x86.msm

Not sure if that will solve the issue though, but those are definitely missing otherwise.

Stefan
Thank you for the tip. Unfortunately, this did not resolve my problem with the install dialog popping up.
S. Butts
+1  A: 

It definitely sounds like you have some COM registration advertised. I highly recommend not advertising: http://robmensching.com/blog/archive/2007/03/12/RobMens-Recommendation-Do-not-advertise-COM-information-in-MSI.aspx.

First, check your source code for anything with Advertise="yes". If that isn't obvious, the Event Log on the machine will have a Windows Installer event that will point to the Component that required the repair/install-on-demand. That should greatly narrow the search.

Rob Mensching
A: 

Thank you for the responses. The tip to check the event viewer was the magic piece. Apparently, there was an entry for an installation file that started with a space. For whatever reason, the WiX compiler allowed this, and the installer installed it, but when the COM component started up for the first time, something in the system or the installer decided this was not kosher, and raised an error. This particular file was completely unrelated to the COM registration. When I removed the space at the start of the name of the file, the problem went away. I am going to take Mr. Mensching's advice and remove the advertising from the file. I was using code generated by one of the WiX tools (I don't remember which one), and for some reason it chose to mark advertise="yes" on the COM components. I definitely do not want the installer trying to do some kind of run-time installation on these COM components.

S. Butts