我正在编写一个 Wix 安装程序来将 .NET 程序集安装到 GAC。简单的...
我的问题是:是否有可能在未来证明这种情况,以便我可以提取在现有网络文件夹中找到的任何程序集并注册它们中的每一个——而不必硬编码确切的程序集名称?这将允许我创建一个可以在未来反复重复使用的单个 MSI。
现在我的代码指向一个单独的 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>