1
我使用heat.exe
收穫調試(或釋放)在生成後事件中使用這個腳本我的Visual Studio項目的目錄中創建一個WiX的安裝程序得到一個安裝有兩個特點:兩個Visual Studio項目
項目一
B項目
的問題是,這兩個項目是指在同一個DLL(xyz.dll
),因此,無論是收穫的過程,此文件具有相同的ID創建一個組件。
編輯
這是收穫版本目錄後,我的輸出文件。
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
<Directory Id="dir325E6775ACBC3561D5CA2F51CFCCC7E8" Name="WixDemoFeature1">
<Component Id="cmp22AE0957A805CEDAC8D05EF04AE18D5E" Guid="*">
<File Id="fil9EDCA091AB8E6440E9D83A815255C794" KeyPath="yes" Source="$(var.WixDemoFeature1.TargetDir)\xyz.dll" />
</Component>
<Component Id="cmpFCBDB8083076AA83E1B67540ADFECC9D" Guid="*">
<File Id="filAA36C3D42B58D430C889BE47087CA911" KeyPath="yes" Source="$(var.WixDemoFeature1.TargetDir)\WixDemoFeature1.exe" />
</Component>
<Component Id="cmp8BCDCA87324BD346D955DDB4318E80BD" Guid="*">
<File Id="fil69700DBD0795710A0AE5DC17574128D5" KeyPath="yes" Source="$(var.WixDemoFeature1.TargetDir)\WixDemoFeature1.exe.config" />
</Component>
</Directory>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="WixDemoFeature1Binaries">
<ComponentRef Id="cmp22AE0957A805CEDAC8D05EF04AE18D5E" />
<ComponentRef Id="cmpE0CAA29B7BB706D56252E85F7C1DDD0A" />
<ComponentRef Id="cmp8BCDCA87324BD346D955DDB4318E80BD" />
</ComponentGroup>
</Fragment>
</Wix>
和
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
<Directory Id="dir325E6775ACBC3561D5CA2F51CFCCC7E8" Name="WixDemoFeature2">
<Component Id="cmp22AE0957A805CEDAC8D05EF04AE18D5E" Guid="*">
<File Id="fil9EDCA091AB8E6440E9D83A815255C794" KeyPath="yes" Source="$(var.WixDemoFeature2.TargetDir)\xyz.dll" />
</Component>
<Component Id="cmpE0CAA29B7BB706D56252E85F7C1DDD0A" Guid="*">
<File Id="fil3A3B754D2B216E86025902C3A826545D" KeyPath="yes" Source="$(var.WixDemoFeature2.TargetDir)\WixDemoFeature2.exe" />
</Component>
<Component Id="cmpFB159630D6E1604557E20776A46EB6B3" Guid="*">
<File Id="fil060CF132A168E46D3C4C1C24CA1AEFF4" KeyPath="yes" Source="$(var.WixDemoFeature2.TargetDir)\WixDemoFeature2.exe.config" />
</Component>
</Directory>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="WixDemoFeature2Binaries">
<ComponentRef Id="cmp22AE0957A805CEDAC8D05EF04AE18D5E" />
<ComponentRef Id="cmpFCBDB8083076AA83E1B67540ADFECC9D" />
<ComponentRef Id="cmpFB159630D6E1604557E20776A46EB6B3" />
</ComponentGroup>
</Fragment>
</Wix>
這兩個XML有分量 「xyz.dll」 同一個ID,所以我不能在我的Product.wxs同時使用 「WixDemoFeature1Binaries」 和 「WixDemoFeature2Binaries」。
我想獲得這些來代替:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
<Directory Id="dir325E6775ACBC3561D5CA2F51CFCCC7E8" Name="WixDemoFeature1">
<Component Id="cmp_WixDemoFeature1.xyz.dll" Guid="*">
<File Id="fil_WixDemoFeature1.xyz.dll" KeyPath="yes" Source="$(var.WixDemoFeature1.TargetDir)\xyz.dll" />
</Component>
<Component Id="cmp_WixDemoFeature1.WixDemoFeature1.exe" Guid="*">
<File Id="fil_WixDemoFeature1.WixDemoFeature1.exe" KeyPath="yes" Source="$(var.WixDemoFeature1.TargetDir)\WixDemoFeature1.exe" />
</Component>
<Component Id="cmp_WixDemoFeature1.WixDemoFeature1.exe.config" Guid="*">
<File Id="fil_WixDemoFeature1.WixDemoFeature1.exe.config" KeyPath="yes" Source="$(var.WixDemoFeature1.TargetDir)\WixDemoFeature1.exe.config" />
</Component>
</Directory>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="WixDemoFeature1Binaries">
<ComponentRef Id="cmp_WixDemoFeature1.xyz.dll" />
<ComponentRef Id="cmp_WixDemoFeature1.WixDemoFeature1.exe" />
<ComponentRef Id="cmp_WixDemoFeature1.WixDemoFeature1.exe.config" />
</ComponentGroup>
</Fragment>
</Wix>
和
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
<Directory Id="dir325E6775ACBC3561D5CA2F51CFCCC7E8" Name="WixDemoFeature2">
<Component Id="cmp_WixDemoFeature2.xyz.dll" Guid="*">
<File Id="fil_WixDemoFeature2.xyz.dll" KeyPath="yes" Source="$(var.WixDemoFeature2.TargetDir)\xyz.dll" />
</Component>
<Component Id="cmp_WixDemoFeature2.WixDemoFeature2.exe" Guid="*">
<File Id="fil_WixDemoFeature2.WixDemoFeature2.exe" KeyPath="yes" Source="$(var.WixDemoFeature2.TargetDir)\WixDemoFeature2.exe" />
</Component>
<Component Id="cmp_WixDemoFeature2.WixDemoFeature2.exe.config" Guid="*">
<File Id="fil_WixDemoFeature2.WixDemoFeature2.exe.config" KeyPath="yes" Source="$(var.WixDemoFeature2.TargetDir)\WixDemoFeature2.exe.config" />
</Component>
</Directory>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="WixDemoFeature2Binaries">
<ComponentRef Id="cmp_WixDemoFeature2.xyz.dll" />
<ComponentRef Id="cmp_WixDemoFeature2.WixDemoFeature2.exe" />
<ComponentRef Id="cmp_WixDemoFeature2.WixDemoFeature2.exe.config" />
</ComponentGroup>
</Fragment>
</Wix>
我怎樣才能改變這種行爲?
謝謝你,我怎樣才能獲得使用XSLT我的目標?再次感謝你。 – workat
Stack Overflow不是要求代碼的地方,但我無法抗拒[kata](http://en.wikipedia.org/wiki/Kata_(編程))。下次會更好。 –