使用mvs2013或mvs2014的Windows 10上的Wix无法正常工作(使php可执行)

内容来源于 Stack Overflow,并遵循CC BY-SA 3.0许可协议进行翻译与使用

  • 回答 (2)
  • 关注 (0)
  • 查看 (130)

Windows 10与mvs2013或mvs2014上的Wix无法正常工作。

我收到错误:错误 The "GenerateCompileWithObjectPath" task could not be loaded from the assembly \WixTasks.dll. Could not load file or assembly 'file:///c:\WixTasks.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. SetupProject5 C:\Program Files (x86)\MSBuild\Microsoft\WiX\v3.x\wix2010.targets

如果我尝试包含WixTasks.dll到项目中,当mvs2013或mvs2014在构建期间崩溃时。我包括\WixTasks.dllC:\SourceControl\vs2015\SetupProject1\SetupProject1\SetupProject1.wixproj从拆包威克斯二进制文件夹: C:\SourceControl

// C:\SourceControl\vs2015\SetupProject1\SetupProject1\SetupProject1.wixproj

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProductVersion>3.10</ProductVersion>
    <ProjectGuid>0adbe89f-e1ce-4345-90e6-64b8304fa42f</ProjectGuid>
    <SchemaVersion>2.0</SchemaVersion>
    <OutputName>SetupProject1</OutputName>
    <OutputType>Package</OutputType>
     <WixToolPath>C:\SourceControl</WixToolPath>
    <WixTargetsPath>$(WixToolPath)\wix.targets</WixTargetsPath>
    <WixTasksPath>$(WixToolPath)\WixTasks.dll</WixTasksPath>    
    <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
    <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <OutputPath>bin\$(Configuration)\</OutputPath>
    <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
    <DefineConstants>Debug</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <OutputPath>bin\$(Configuration)\</OutputPath>
    <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="Product.wxs" />
  </ItemGroup>
  <Import Project="$(WixTargetsPath)" />
  <!--
    To modify your build process, add your task inside one of the targets below and uncomment it.
    Other similar extension points exist, see Wix.targets.
    <Target Name="BeforeBuild">
    </Target>
    <Target Name="AfterBuild">
    </Target>
    -->

过去两天我正在阅读不同的在线论坛和例子。另外Pact还是由Nick Ramirez在wix上发表的书。没有什么工作。

提问于
用户回答回答于

我刚刚遇到这个问题,发现在wix2010.targets文件的顶部是以下属性组。

<PropertyGroup>
<WixInstallPath Condition=" '$(WixInstallPath)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Installer XML\3.11@InstallRoot)</WixInstallPath>
<WixInstallPath Condition=" '$(WixInstallPath)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows Installer XML\3.11@InstallRoot)</WixInstallPath>

检查引用的注册表路径时,3.11没有条目,但3.10有一个条目。并且已安装的版本报告为3.10。因此,更新属性组到以下更正了我的问题。

<PropertyGroup>
<WixInstallPath Condition=" '$(WixInstallPath)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Installer XML\3.10@InstallRoot)</WixInstallPath>
<WixInstallPath Condition=" '$(WixInstallPath)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows Installer XML\3.10@InstallRoot)</WixInstallPath>

希望这可以帮助。

用户回答回答于

定义以下MSBuild变量,一切都应该有效。

<WixRootPath Condition=" '$(WixRootPath)' == '' ">$(MSBuildThisFileDirectory)Tools\wix\$(WixTargetVersion)\</WixRootPath>
<WixToolPath Condition=" '$(WixToolPath)' == '' ">$(WixRootPath)</WixToolPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(WixRootPath)Wix.targets</WixTargetsPath>
<WixCATargetsPath Condition=" '$(WixCATargetsPath)' == '' ">$(WixRootPath)sdk\Wix.CA.targets</WixCATargetsPath>
<WixTasksPath Condition=" '$(WixTasksPath)' == '' ">$(WixToolPath)WixTasks.dll</WixTasksPath>
<WixSdkPath Condition=" '$(WixSdkPath)' == '' ">$(WixRootPath)sdk\</WixSdkPath>

只要确保路径正确。这些路径用于wix 3.10.2二进制文件,我在构建机器上检查我的构建。

我认为构建任务应该在WIX环境变量定义的路径中查找,但我不是100%肯定。

认为用您设置的路径定义所有变量应该修复所有内容,因为错误提到在C:\ WixTasks.dll查找通常它寻找的路径类似于$(WixInstallPath)WixTasks.dll但是如果$(WixInstallPath)isn'正确定义它只是空,默认为C:\ WixTasks.dll。你确实定义了$(WixTasksPath),但我认为它被覆盖了一些原因......

无论如何,你的系统现在出现了问题,但你可以通过这种方式解决它。

编辑:如果以上操作无效,请从此处下载wix二进制文件并将其解压缩到名为“Wix”的文件夹或任何您想要调用的文件夹中。然后将WixRootPath设置为等于该位置。

所属标签

可能回答问题的人

  • 嗨喽你好

    7 粉丝480 提问9 回答
  • uncle_light

    5 粉丝518 提问8 回答
  • 富有想象力的人

    3 粉丝0 提问7 回答
  • 无聊至极

    4 粉丝504 提问6 回答

扫码关注云+社区

领取腾讯云代金券