【问题标题】:Visual Studio WiX installer project deleting msi output on RebuildVisual Studio WiX 安装程序项目在重建时删除 msi 输出
【发布时间】:2012-01-25 16:06:27
【问题描述】:

我从最近离开的承包商那里继承了一个 WiX 项目。

当我构建 WiX 安装程序项目时,没有问题 - .msi 已按预期构建并输出。

但是当我“重建”WiX 安装程序项目时,.msi 再次被 light.exe 构建得很好,但随后被“CoreClean”删除。

更多信息:wix 项目打包(和引用)单个 Web 项目。

这是输出的sn-p:

ICE105: ICE105 - Validates the package to make sure that it can be installed in true Per-User mode
        ICE105: Created 05/01/2008. Last Modified 05/21/2008.
        Laying out media.
        Moving file 'C:\Users\codemonkey\AppData\Local\Temp\nxkfdvui\AmazonWebsiteInstaller.msi' to 'C:\web\main\Amazon.Webby.Install\bin\Release\AmazonWebsiteInstaller.msi'.
    Done executing task "Light".
    ...
    ...
Target "CoreClean" in file "C:\Program Files (x86)\MSBuild\Microsoft\WiX\v3.x\wix2010.targets" from project "C:\web\main\Amazon.Webby.Install\Amazon.Webby.Install.wixproj" (target "Clean" depends on it):
    Task "ReadLinesFromFile"
    Done executing task "ReadLinesFromFile".
    Task "FindUnderPath"
        Comparison path is "bin\Release\".
    Done executing task "FindUnderPath".
    Task "FindUnderPath"
        Comparison path is "obj\Release\".
    Done executing task "FindUnderPath".
    Task "Delete"
        Deleting file "C:\web\main\Amazon.Webby.Install\bin\Release\AmazonWebsiteInstaller.msi".
        Deleting file "C:\web\main\Amazon.Webby.Install\bin\Release\AmazonWebsiteInstaller.wixpdb".
        Deleting file "obj\Release\MainWixComponents.wixobj".
        Deleting file "obj\Release\UploadContent.wixobj".
        Deleting file "obj\Release\WebSiteContent.wixobj".
        Deleting file "obj\Release\Product.Generated.wixobj".
    Done executing task "Delete".   
    ...
    ...

我在安装程序项目文件中找不到任何涉及 msi 或输出文件夹的删除任务,因此这是 Visual Studio 进行重建并认为它需要清除它没有的文件的结果。

这似乎是“C:\Program Files (x86)\MSBuild\Microsoft\WiX\v3.x\wix2010.targets”中的相关部分导致新构建的 msi 被删除:

<!--
==================================================================================================
CoreClean

Cleans all of the compile and link outputs as well as any intermediate files generated along
the way.
==================================================================================================
-->
<PropertyGroup>
<CoreCleanDependsOn></CoreCleanDependsOn>
</PropertyGroup>
<Target
Name="CoreClean"
DependsOnTargets="$(CoreCleanDependsOn)">
...
<!-- Delete those files. -->
<Delete Files="@(_CleanPriorFileWritesInOutput);@(_CleanPriorFileWritesInIntermediate)" TreatErrorsAsWarnings="true">
<Output TaskParameter="DeletedFiles" ItemName="_CleanPriorFileWritesDeleted" />
</Delete>
...

有什么想法吗?

谢谢。

【问题讨论】:

    标签: visual-studio-2010 visual-studio wix windows-installer


    【解决方案1】:

    我知道它已经过时了,但这在 SourceForge 中作为一个已修复的错误被提及:

    http://sourceforge.net/tracker/?func=detail&atid=642714&aid=1719357&group_id=105970

    您使用的是 3.0.4102.0 之后的版本吗?

    对于这个错误是否真的在 cmets 中得到修复似乎存在一些争论。

    【讨论】:

    • 不幸的是我没有时间尝试这个。虽然我在 3.6 版。我赞成您的回答,因为它可能对其他人有所帮助。
    【解决方案2】:

    为了解决这个问题,我从 wixproj 文件中提取了所有 InitialTargets 步骤(它们是 msbuild.exe 调用),并将它们移动到从预构建事件项目属性调用的批处理脚本中。我这样做是因为还有另一个问题 - 加载项目时正在构建目标项目,这意味着打开解决方案需要很长时间。无论如何,将所有内容移动到批处理文件中解决了这两个问题。

    【讨论】:

      猜你喜欢
      • 2014-10-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多