[wix-users] quick question re SharedDllRefCount... [P]

Hoover, Jacob Jacob.Hoover at greenheck.com
Fri Oct 23 13:20:02 PDT 2015


Not 100% certain on this but I always assumed shared components should use the same component ID, and should all install to the same location. I would also avoid SelfReg like the plague.

Ref: http://blogs.msdn.com/b/heaths/archive/2009/12/21/about-shared-components.aspx

"The same component GUID can be registered by multiple products. This provides for multiple products to install shared resources. However, it is a common misconception that only by defining the same GUID is a shared component defined. Both the GUID and the component key path must be the same."

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Steven Ogilvie
Sent: Friday, October 23, 2015 3:10 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] quick question re SharedDllRefCount... [P]

Classification: Public
Hi folks,

sigh I can't remember this for the life of me...

Okay I have 2 products called A and B

Within A I have File_X in two different MSI's being installed to 2 different placesIn B I have File_X being installed to another location File_X is a COM file that is registered So if I want to install A then B or B then A and later uninstall one of them I do NOT want the COM registration to be removed...

INSTALL A:

MSI 1:
<Component Id="cmp_TL_MyFile" Guid="{D4EDBCFA-...}" Shared="yes" SharedDllRefCount="yes">              <!-- Need to use SelfRegCost and the Class/TypeLib elements in order for the DLL to load properly -->              <File Id="file_TL_MyFile" KeyPath="yes" Source="$(var.somePath)\TL_MyFile.dll" SelfRegCost="1">                <Class Id="{F1A000BF-CF05-...}" Context="InprocServer32" Description="TL_MyFile OleDocumentProperties" ThreadingModel="apartment">                  <ProgId Id="TL_MyFile.OleDocumentProperties" Description="My Company OLE Document Properties Reader 2.1" />                </Class>                <TypeLib Id="{F1A000BF-CF00-...}" Description="My Company OLE Document Properties Reader 2.1" HelpDirectory="WixLibRedirectFolder" Language="0" MajorVersion="2" MinorVersion="1">                  <Interface Id="{F1A000BF-CF01-...}" Name="_OleDocumentProperties" ProxyStubClassId32="{00020424-...}" />                  <Interface Id="{F1A000BF-CF02-...}" Name="Summar
 yProperties" ProxyStubClassId32="{00020424-...}" />                  <Interface Id="{F1A000BF-CF03-...}" Name="CustomProperty" ProxyStubClassId32="{00020424-...}" />                  <Interface Id="{F1A000BF-CF04-...}" Name="CustomProperties" ProxyStubClassId32="{00020424-...}" />                </TypeLib>              </File>         </Component>

MSI 2:
<Component Id="cmp_TL_MyFileDll" Guid="{3969ED7B-...}" Shared="yes" SharedDllRefCount="yes">            <!-- Need to use SelfRegCost and the Class/TypeLib elements in order for the DLL to load properly -->            <File Id="file_TL_MyFileDll" KeyPath="yes" Source="$(var.somePath)\TL_MyFile.dll" SelfRegCost="1">              <Class Id="{F1A000BF-CF05-...}" Context="InprocServer32" Description="TL_MyFile OleDocumentProperties" ThreadingModel="apartment">                <ProgId Id="TL_MyFile.OleDocumentProperties" Description="My Company OLE Document Properties Reader 2.1" />              </Class>              <TypeLib Id="{F1A000BF-CF00-...}" Description="My Company OLE Document Properties Reader 2.1" HelpDirectory="WixLibRedirectFolder" Language="0" MajorVersion="2" MinorVersion="1">                <Interface Id="{F1A000BF-CF01-...}" Name="_OleDocumentProperties" ProxyStubClassId32="{00020424-...}" />                <Interface Id="{F1A000BF-CF02-...}" Name="SummaryPropertie
 s" ProxyStubClassId32="{00020424-...}" />                <Interface Id="{F1A000BF-CF03-...}" Name="CustomProperty" ProxyStubClassId32="{00020424-...}" />                <Interface Id="{F1A000BF-CF04-...}" Name="CustomProperties" ProxyStubClassId32="{00020424-...}" />              </TypeLib>            </File>        </Component>

INSTALL B:
<Component Id="cmp_TL_MyFileDll" Guid="{FF5D759D-...}" Shared="yes" SharedDllRefCount="yes">          <!-- Need to use SelfRegCost and the Class/TypeLib elements in order for the DLL to load properly -->            <File Id="file_TL_MyFileDll" KeyPath="yes" Source="$(var.somePath)\TL_MyFile.dll" SelfRegCost="1">              <Class Id="{F1A000BF-CF05-...}" Context="InprocServer32" Description="TL_MyFile OleDocumentProperties" ThreadingModel="apartment">                <ProgId Id="TL_MyFile.OleDocumentProperties" Description="My Company OLE Document Properties Reader 2.1" />              </Class>              <TypeLib Id="{F1A000BF-CF00-...}" Description="My Company OLE Document Properties Reader 2.1" HelpDirectory="DIRECTORY_PATH_PLUGINS" Language="0" MajorVersion="2" MinorVersion="1">                <Interface Id="{F1A000BF-CF01-...}" Name="_OleDocumentProperties" ProxyStubClassId32="{00020424-...}" />                <Interface Id="{F1A000BF-CF02-...}" Name="SummaryPropertie
 s" ProxyStubClassId32="{00020424-...}" />                <Interface Id="{F1A000BF-CF03-...}" Name="CustomProperty" ProxyStubClassId32="{00020424-...}" />                <Interface Id="{F1A000BF-CF04-...}" Name="CustomProperties" ProxyStubClassId32="{00020424-...}" />              </TypeLib>            </File>        </Component>

The component GUID is different for each component The Class ID is the same for the three components The TypeLib ID is the same for the three components The Interface ID's are the same for the three components 

If I uninstall A, and B is left behind, File_X is not longer registered as a COM object...
What am I doing wrong?

Thanks,
Steveps have a great weekend all! 		 	   		  

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
 



 
This message has been marked as Public by Steven Ogilvie on October-23-15 4:10:13 PM.

The above classification labels were added to the message by TITUS Message Classification. For more information visit www.titus.com.

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/


More information about the wix-users mailing list