某些文件在第一次使用WIX时未在安装文件夹中复制
问题描述:
最近我使用WIX为我的WPF应用程序创建安装程序,我需要将大量的dll文件复制到安装文件夹中。问题是,第一次使用安装程序时,其中一些没有被复制到文件夹中,但是它是第二次。当计算机中已安装较旧版本的软件时会发生这种情况。某些文件在第一次使用WIX时未在安装文件夹中复制
<!-- Telerik Dlls -->
<Component Id="Telerik.Windows.Controls.Chart.dll" Guid="8bd4b407-1ecb-40d7-b4c3-000000000014">
<File Id="Telerik.Windows.Controls.Chart.dll" Source="..\..\bin\vc100\Win32\Release\Telerik.Windows.Controls.Chart.dll" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="Telerik.Windows.Controls.Data.dll" Guid="8bd4b407-1ecb-40d7-b4c3-000000000015">
<File Id="Telerik.Windows.Controls.Data.dll" Source="..\..\bin\vc100\Win32\Release\Telerik.Windows.Controls.Data.dll" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="Telerik.Windows.Controls.DataVisualization.dll" Guid="8bd4b407-1ecb-40d7-b4c3-000000000016">
<File Id="Telerik.Windows.Controls.DataVisualization.dll" Source="..\..\bin\vc100\Win32\Release\Telerik.Windows.Controls.DataVisualization.dll" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="Telerik.Windows.Controls.dll" Guid="8bd4b407-1ecb-40d7-b4c3-000000000017">
<File Id="Telerik.Windows.Controls.dll" Source="..\..\bin\vc100\Win32\Release\Telerik.Windows.Controls.dll" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="Telerik.Windows.Controls.Docking.dll" Guid="8bd4b407-1ecb-40d7-b4c3-000000000018">
<File Id="Telerik.Windows.Controls.Docking.dll" Source="..\..\bin\vc100\Win32\Release\Telerik.Windows.Controls.Docking.dll" KeyPath="yes" Checksum="yes"/>
</Component>
<!-- Modules -->
<Component Id="MCManager.dll" Guid="8bd4b407-1ecb-40d7-b4c3-000000000001">
<File Id="MCManager.dll" Source="..\..\bin\vc100\Win32\Release\MCManager.dll" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="NavigationManager.dll" Guid="8bd4b407-1ecb-40d7-b4c3-000000000002">
<File Id="NavigationManager.dll" Source="..\..\bin\vc100\Win32\Release\NavigationManager.dll" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="MCTools.dll" Guid="8bd4b407-1ecb-40d7-b4c3-000000000003">
<File Id="MCTools.dll" Source="..\..\bin\vc100\Win32\Release\MCTools.dll" KeyPath="yes" Checksum="yes"/>
</Component>
Telerik dll的问题出现了,其他的问题在第一次安装时就被复制了。
在此先感谢:)
答
这似乎是文件版本控制的问题。例如,如果较新版本的安装程序尝试在较高版本的文件上安装较低版本的文件,则这些文件将被忽略。为了解决这个问题,你可以将下面一行添加到您的WiX的项目,强制安装程序始终覆盖文件,如果版本不同,而不是仅仅将文件,如果它们是新的:
<Property Id="REINSTALLMODE" Value="dmus" />
检查安装的文件在新版本的安装程序中具有比旧安装程序安装的相同文件更高的文件版本。 –
如何为文件设置新版本?谢谢! – OriolBur
这不是你要在WiX中设置的东西,这些文件本身会有自己的版本信息。如果您希望WiX忽略文件版本并覆盖它们,请将以下行添加到您的安装程序中: –