第一次使用WIX

时间:2017-10-05 12:52:02

标签: c# wpf wix

最近我使用WIX为我的WPF应用程序创建安装程序,我需要将许多dll复制到安装文件夹中。问题是,第一次使用安装程序时,其中一些没有被复制到文件夹中,但它第二次执行。当计算机中已安装旧版本的软件时会发生这种情况。

<!-- 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出现问题,在第一次安装中复制其他的尝试正确。

提前致谢:)

1 个答案:

答案 0 :(得分:-1)

这似乎是文件版本控制的问题。例如,如果较新版本的安装程序尝试在较高版本的文件上安装较低版本的文件,则将忽略这些文件。要解决这个问题,您可以将以下行添加到您的WiX项目中,以强制安装程序在版本不同时始终覆盖文件,而不是仅在新文件添加时添加文件:

<Property Id="REINSTALLMODE" Value="dmus" />