I am trying to generate a COM+ App that includes a .NET DLL that is installed 
in the GAC. I am able to get the following project sample to successfully 
install on Windows 2000 with .NET 2.0. This sample does not put the COM+ DLL in 
the GAC, but it does put a dependency (CSLA) in the GAC.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension";
     xmlns:complus="http://schemas.microsoft.com/wix/ComPlusExtension";>
        <Product Id="c2b16a12-ac2d-4974-93ed-9f489a3f0603" Name="TestInstaller" 
Language="1033" Version="1.0.0.0" Manufacturer="TestInstaller" 
UpgradeCode="abdf00e1-a390-4f83-b3d3-f4d56b8d2d2d">
                <Package InstallerVersion="200" Compressed="no" />

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

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLDIR" Name="MyProduct" 
FileSource="$(var.FileRoot)\ServerSource">
          <Directory Id="MiddleTier" Name="MiddleTier">
            <Component Id="Csla.dll" 
Guid="{5E9AAC87-7163-40CE-82C2-A9D27E80CD8D}">
              <Class Id="{70EDECB2-0850-3623-A676-B78A19A5F9FD}" 
Context="InprocServer32" Description="Csla.Server.ServicedDataPortal" 
ThreadingModel="both" ForeignServer="mscoree.dll">
                <ProgId Id="Csla.Server.ServicedDataPortal" 
Description="Csla.Server.ServicedDataPortal"/>
              </Class>
              <File Id="Csla.dll" Name="Csla.dll" KeyPath="yes" Assembly=".net" 
Source="$(var.FileRoot)\ClientAssemblies\Csla.dll"/>
            </Component>
            <Component Id="MyProduct.EnterpriseServicesHost.dll" 
Guid="{74CA7262-9003-43FB-BCCD-EAD0E7A88DCF}">
              <Class Id="{E8E5308E-6B44-3DBC-8F04-8F35CE437F0B}" 
Context="InprocServer32" 
Description="MyProduct.EnterpriseServicesHost.EnterpriseServicesPortal" 
ThreadingModel="both" ForeignServer="mscoree.dll">
                <ProgId 
Id="MyProduct.EnterpriseServicesHost.EnterpriseServicesPortal" 
Description="MyProduct.EnterpriseServicesHost.EnterpriseServicesPortal" />
              </Class>
              <File Id="MyProduct.EnterpriseServicesHost.dll"
                    Name="MyProduct.EnterpriseServicesHost.dll" KeyPath="yes"
                    Assembly="no"
                    
Source="$(var.FileRoot)\ClientAssemblies\MyProduct.EnterpriseServicesHost.dll"/>
              <complus:ComPlusApplication Id="MyProduct" 
ApplicationId="{3323762F-6B27-11D5-BC30-009027CC66CD}" Name="MyProduct"
                AccessChecksLevel="applicationLevel" 
ApplicationAccessChecksEnabled="no" Authentication="none"
                Identity="[MYUSERNAME]" Password="[MYPASSWORD]">
                <complus:ComPlusAssembly Id="MyProduct.EnterpriseServicesHost"
                                         
DllPath="[#MyProduct.EnterpriseServicesHost.dll]"
                                         
TlbPath="[#MyProduct.EnterpriseServicesHost.tlb]"
                                         Type=".net" RegisterInCommit="yes">
                  <complus:ComPlusComponent Id="EnterpriseServicesPortal"  
CLSID="E8E5308E-6B44-3DBC-8F04-8F35CE437F0B" 
Description="MyProduct.EnterpriseServicesHost.EnterpriseServicesPortal"/>
                </complus:ComPlusAssembly>
              </complus:ComPlusApplication>
            </Component>
            <Component Id="MyProduct.EnterpriseServicesHost.tlb" 
Guid="17F7F642-0D4C-46EC-BD4C-EB69B888BE83">
              <File Id="MyProduct.EnterpriseServicesHost.tlb" 
Source="$(var.FileRoot)\ClientAssemblies\MyProduct.EnterpriseServicesHost.tlb" 
KeyPath="yes"/>
            </Component>
          </Directory>
        </Directory>
      </Directory>
                </Directory>

                <Feature Id="ProductFeature" Title="TestInstaller" Level="1">
      <ComponentRef Id="MyProduct.EnterpriseServicesHost.dll"/>
      <ComponentRef Id="MyProduct.EnterpriseServicesHost.tlb"/>
      <ComponentRef Id="Csla.dll"/>
                </Feature>
        </Product>
</Wix>

To use the GAC, I make three changes:
o Set File/@Assembly to ".net" instead of "no" on the "Host" DLL o Remove the 
DLLPath attribute from the ComPlusAssembly element.
o Add DLLPathFromGAC = "yes" to the ComPlusAssembly element.

When I run this install, it fails with the following info in the log:
MSI (s) (F4:3C) [23:03:24:458]: Invoking remote custom action. DLL: 
C:\WINNT\Installer\MSI44.tmp, Entrypoint: ComPlusInstallExecuteCommit
ComPlusInstallExecuteCommit:  Registering assembly, key: 
MyProduct.EnterpriseServicesHost
ComPlusInstallExecuteCommit:  Error 0x80070490: Failed to get path for assembly 
from GAC
ComPlusInstallExecuteCommit:  Error 0x80070490: Failed to register assembly, 
key: MyProduct.EnterpriseServicesHost
ComPlusInstallExecuteCommit:  Error 0x80070490: Failed to register assemblies

When I used ProcMon to monitor the activity, I saw that the DLL was being put 
in the GAC. Specifically, it was going into the GAC_MSIL folder. Then, at the 
time registration would be happening, I saw a file request for the DLL from the 
GAC folder, which was not found.

I'm not sure exactly what is going on here. I need to put the DLLs in the GAC 
because Windows 2000 COM+ applications don't have an application root folder. 
Without the GAC, I'd have to put the .NET DLLs in the System32 folder.

Is this a misconfigured project, a bug in the Wix extension, a problem in .NET, 
or what? Do I have any workaround options?

Oh, I almost forgot... this is built with WIX v3.0.5006 (built 06-Feb-09).

- Don Benson -

CONFIDENTIALITY NOTICE: This email and any files transmitted with it are the 
property of Tribute Inc. and/or its affiliates. The contents of this 
communication are confidential and may contain information that is privileged 
and/or exempt from disclosure under applicable law. It is intended solely for 
use of the individual or entity to whom this email is addressed. If you are not 
one of the named recipient(s) or otherwise have reason to believe that you have 
received this message in error, please notify the sender and immediately delete 
this message and any attachments. Any unauthorized use, retention, 
dissemination, forwarding, printing, or copying of this email is strictly 
prohibited.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to