我使用CopyFile标签解决了类似的问题;
某处我有一个<Directory>
含有下列成分:
<Component Id="Config_6.txt" Guid="{}">
<File Id="Config_6.txt" Name="Config_6.txt" KeyPath="yes" Source="..\..\..\bin\Config_6.txt" />
</Component>
<Component Id="Config.txt" Guid="{}">
<File Id="Config.txt" Name="Config_8.txt" KeyPath="yes" Source="..\..\..\bin\Config.txt" />
</Component>
<Component Id="Config_7.txt" Guid="{}">
<File Id="Config_7.txt" Name="Config_7.txt" KeyPath="yes" Source="..\..\..\bin\Config_7.txt" />
</Component>
<Component Id="R8_Config.txt" Guid="{}">
<CreateFolder/>
<CopyFile Id="R8_Config.txt" FileId="Config.txt" DestinationName="Config.txt"/>
</Component>
<Component Id="R7_Config.txt" Guid="{}">
<CreateFolder/>
<CopyFile Id="R7_Config.txt" FileId="Config_7.txt" DestinationName="Config.txt"/>
</Component>
<Component Id="R6_Config.txt" Guid="{}">
<CreateFolder/>
<CopyFile Id="R6_Config.txt" FileId="Config_6.txt" DestinationName="Config.txt"/>
</Component>
而且在功能部分是这样的:
<Feature Id="Config" Title="Config directory" Display="expand" Level="1" ConfigurableDirectory="Config">
<Feature Id="Config8" Title="Config 8" Level="1" Description="Select only one version!">
<ComponentRef Id="R8_Config.txt"/>
</Feature>
<Feature Id="Config7" Title="Config 7" Level="1002" Description="Select only one version!">
<ComponentRef Id="R7_Config.txt"/>
</Feature>
<Feature Id="Config6" Title="Config 6" Level="1004" Description="...">
<ComponentRef Id="R6_Config.txt"/>
</Feature>
</Feature>
要显示的功能,添加包含CustomizeDlg
一个UIRef,为例如:
<UIRef Id="WixUI_FeatureTree" />
A unfavanta这个解决方案的ge是用户可以选择多个配置文件。这可能会导致最后一名成为活跃分子。
您可以安装配置文件。在安装过程中,要求用户选择配置。然后在'InstallFinalize'之前安排一个自定义动作,它将把用户选择的配置复制到config.txt文件中。 – 2011-06-02 16:49:26