代码之家  ›  专栏  ›  技术社区  ›  Jason Irwin

Wix-将程序集动态注册到GAC

  •  1
  • Jason Irwin  · 技术社区  · 16 年前

    我正在编写一个Wix安装程序,将.NET程序集安装到GAC。容易的。。。

    现在,我的代码指向一个单独的DLL,如下所示:

    <?xml version="1.0" encoding="UTF-8"?>
    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
        <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>
    
    1 回复  |  直到 16 年前
        1
  •  3
  •   Rob Mensching    16 年前

    不,不是真的。MSI中必须更新的不仅仅是文件。例如,ProductCode(Product/@Id)对于每个单独的安装都需要是唯一的。文件表信息都需要更新。我肯定还有其他一些事情我忘记了,因为WiX工具集处理了这一切。