WIX component question

K

kanepart2

Hello ,

I have to install 2 dlls to the GAC using an MSI created by WIX. The
following piece of code works as desired :-

<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='WixExampleProductFolder' Name='Example'
LongName='Test Directory'>
<Component Id="Assemblies_GAC" Guid="D50D93D8-B5EF-46f4-
A304-869ADBA389F9" DiskId="1">
<File Id="foo_GAC.dll" KeyPath="yes" Assembly=".net"
ProcessorArchitecture="msil" Name="foo1.dll"
LongName="xxxxxxxxxxxxxxxxxxx.dll" src="C:\xxxxxxxxxxxxxxxxxxx.dll" />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id='TestFileProductFeature' Title='Wix File Product Feature'
Level='1'>
<ComponentRef Id='Assemblies_GAC' />
</Feature>

---------------------------------------------------------------------------------------------------------------------------------------

the above code installs xxxxxxxxxxxxxxxxxxxxx.dll to the GAC but when
I try to install a second dll (yyyyyyyyyyyyyyy.dll) into the GAC using
the following piece of code:-


<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='WixExampleProductFolder' Name='Example'
LongName='Test Directory'>
<Component Id="Assemblies_GAC" Guid="D50D93D8-B5EF-46f4-
A304-869ADBA389F9" DiskId="1">
<File Id="foo_GAC.dll" KeyPath="yes" Assembly=".net"
ProcessorArchitecture="msil" Name="foo1.dll"
LongName="xxxxxxxxxxxxxxxxxxx.dll" src="C:\xxxxxxxxxxxxxxxxxxx.dll" />
</Component>
<Component Id="Assemblies_GAC" Guid="D50D93D8-B5EF-46f4-
A304-869ADBA389F9" DiskId="1">
<File Id="foo_GAC.dll" KeyPath="yes" Assembly=".net"
ProcessorArchitecture="msil" Name="foo1.dll"
LongName="yyyyyyyyyyyyyyy.dll" src="C:\yyyyyyyyyyyyyyyyyy.dll" />
</Component>

</Directory>
</Directory>
</Directory>
<Feature Id='TestFileProductFeature' Title='Wix File Product Feature'
Level='1'>
<ComponentRef Id='Assemblies_GAC' />
</Feature>


I get the following error:-

Duplicate symbol 'Component:Assemblies_GAC' found.


So basically my question is how do I install multiple dlls into the
GAC using the same MSI?
 
J

John Vottero

Hello ,

I have to install 2 dlls to the GAC using an MSI created by WIX. The
following piece of code works as desired :-

<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='WixExampleProductFolder' Name='Example'
LongName='Test Directory'>
<Component Id="Assemblies_GAC" Guid="D50D93D8-B5EF-46f4-
A304-869ADBA389F9" DiskId="1">
<File Id="foo_GAC.dll" KeyPath="yes" Assembly=".net"
ProcessorArchitecture="msil" Name="foo1.dll"
LongName="xxxxxxxxxxxxxxxxxxx.dll" src="C:\xxxxxxxxxxxxxxxxxxx.dll" />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id='TestFileProductFeature' Title='Wix File Product Feature'
Level='1'>
<ComponentRef Id='Assemblies_GAC' />
</Feature>

---------------------------------------------------------------------------------------------------------------------------------------

the above code installs xxxxxxxxxxxxxxxxxxxxx.dll to the GAC but when
I try to install a second dll (yyyyyyyyyyyyyyy.dll) into the GAC using
the following piece of code:-


<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='WixExampleProductFolder' Name='Example'
LongName='Test Directory'>
<Component Id="Assemblies_GAC" Guid="D50D93D8-B5EF-46f4-
A304-869ADBA389F9" DiskId="1">
<File Id="foo_GAC.dll" KeyPath="yes" Assembly=".net"
ProcessorArchitecture="msil" Name="foo1.dll"
LongName="xxxxxxxxxxxxxxxxxxx.dll" src="C:\xxxxxxxxxxxxxxxxxxx.dll" />
</Component>
<Component Id="Assemblies_GAC" Guid="D50D93D8-B5EF-46f4-
A304-869ADBA389F9" DiskId="1">
<File Id="foo_GAC.dll" KeyPath="yes" Assembly=".net"
ProcessorArchitecture="msil" Name="foo1.dll"
LongName="yyyyyyyyyyyyyyy.dll" src="C:\yyyyyyyyyyyyyyyyyy.dll" />
</Component>

</Directory>
</Directory>
</Directory>
<Feature Id='TestFileProductFeature' Title='Wix File Product Feature'
Level='1'>
<ComponentRef Id='Assemblies_GAC' />
</Feature>


I get the following error:-

Duplicate symbol 'Component:Assemblies_GAC' found.


So basically my question is how do I install multiple dlls into the
GAC using the same MSI?


You have to give each Component a unique ID and reference both of the
components in the Feature.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top