views:

651

answers:

1

I am writing a Wix installer to install .NET assemblies to the GAC. Easy...

My question is: is it possible to future proof this scenario so that I can pull ANY assemblies found in an existing network folder and register each of them - without having to hardcode the exact assembly names? This would allow me to create a single MSI that could be reused over and over again in the future.

Right now my code points to an individual DLL and looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"&gt;
    <Product Id="16c27e1f-8f59-40bc-9ce6-ba816eae4323" Name="GACInstaller" Language="1033" Version="1.0.0.0" Manufacturer="GACInstaller" UpgradeCode="7fb35788-63aa-4cb1-9ad2-fd965cdeb7c8">
    <Package InstallerVersion="200" Compressed="yes" />

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

     <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
       <Directory Id="INSTALLLOCATION" Name="GACInstaller">
        <Component Id="ProductComponent" Guid="ae2bb9bd-f8d6-4060-b25b-8147fac155d6"> 
            <File Id='my_assembly' Name='my_assembly.dll' KeyPath='yes' Assembly='.net' Source='C:\my_assembly.dll' /> 
        </Component> 
       </Directory>
      </Directory>
     </Directory>

     <Feature Id="ProductFeature" Title="GACInstaller" Level="1">
      <ComponentRef Id="ProductComponent" /> 
    </Feature>
    </Product>
</Wix>
+2  A: 

No, not really. More than just the file must be updated in the MSI. For example, the ProductCode (Product/@Id) needs to be unique for each individual install. The File table information all needs to be updated. I'm sure there are other things I'm forgetting since the WiX toolset takes care of it all.

Rob Mensching
well, that is pretty definitive. Thanks Rob!
Jason Irwin