至于将特定DLL的AssemblyVersion绑定到WiX文件版本,基本上很简单:
<Product Id="*"
Name="My Application"
Language="1033"
Version="!(bind.FileVersion.MyDll.dll)"
Manufacturer="My Company"
UpgradeCode="E7A0C56F-160B-4C67-9AAC-2FF69630EAF9">
有什么方法可以通过WiX中的属性实现相同的效果。像这样:
<Property Id="VERSION">
<![CDATA[!(bind.FileVersion.MyDll.dll)]]>
</Property>
我需要在安装期间更新XML文件,其版本号与特定DLL中的版本号相同。有什么建议吗?
答案 0 :(得分:0)
您应该查看XmlFile元素。它允许您设置值/属性:
<Component Id="webconfig" Guid="PUT-YOUR-GUID-HERE" NeverOverwrite="yes" Win64="yes">
<File Id="web.config" Source="$(var.bind.ProjectDir)\web.config" KeyPath="yes" />
<util:XmlFile Id="web.config.VersionInfo" File="[#web.config]" Action="setValue" PreserveModifiedDate="yes" ElementPath="//configuration/appSettings/add[\[]@key='VersionInfo'[\]]" Name="value" Value="[VERSION]" Sequence="1" />
</Component>