首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >带有mvs2013或mvs2014的Windows10上的Wix无法工作(使php成为可执行文件)

带有mvs2013或mvs2014的Windows10上的Wix无法工作(使php成为可执行文件)
EN

Stack Overflow用户
提问于 2016-05-10 02:27:01
回答 4查看 1.7K关注 0票数 1

带有mvs2013或mvs2014的Windows10上的Wix不工作。

我收到错误: Error 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在构建过程中崩溃时。我将解压后的wix二进制文件文件夹C:\SourceControl中的\WixTasks.dll包含到C:\SourceControl\vs2015\SetupProject1\SetupProject1\SetupProject1.wixproj

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

代码语言:javascript
复制
<?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>
    -->

在过去的两天里,我阅读了不同的在线论坛和例子。也有Nick Ramirez写的关于wix的Pact书籍。什么都不起作用。

EN

回答 4

Stack Overflow用户

发布于 2016-06-08 02:02:43

在使用VS2015和使用不同版本的Wix的git分支时,我遇到了这个问题。(我正在升级到最新的Wix版本,但并不是所有的分支都在那里。)

如果在使用Wix的不同版本的git分支之间切换,则必须终止并重新启动VS。VS保留了一些打开的Wix文件,这些文件在任何其他版本的Wix上都无法工作。如果您忘记执行此操作,您的VS生成将失败,并显示以下消息(相当隐蔽):“无法从程序集C:\Program Files (x86)\WiX Toolset v3.10\bin\WixTasks.dll加载”"GenerateCompileWithObjectPath“”任务“”

票数 1
EN

Stack Overflow用户

发布于 2016-05-10 23:46:58

来自WiX Cookbook的工作解决方案,Nick Ramirez,2015,Chapter1“从命令行构建WiX安装程序”,示例4 "BuildMachineInstaller“

下载并解压缩wix二进制文件,例如从here下载。1.为你的项目创建一些文件夹,例如包含Product.wxs文件的C:\SourceControl\own\box1。2.将二进制文件解压到某个文件夹,例如C:\SourceControl\own\box1\tools\wix 3.启动windows命令行工具cmd并切换到你的项目文件夹。执行candlelight命令,如下所示:

C:\SourceControl\own\box1>C:\SourceControl\own\box1\tools\wix\candle *.wxs -o obj\

C:\SourceControl\own\box1>C:\SourceControl\own\box1\tools\wix\light obj\*.wixobj -o bin\CommandLineInstaller.msi

无论如何,如果有人能给出一些工作示例文件,并描述如何使用MSBuild或Visual Studio Build和wix来制作*.exe或*.msi,我将不胜感激。Pact书籍中的其他示例并不是通过纯粹的复制来工作的,尽管它们对于一般理解非常有用。

票数 0
EN

Stack Overflow用户

发布于 2016-05-17 22:35:26

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

代码语言:javascript
复制
<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。因此,将属性组更新为以下内容为我更正了这个问题。

代码语言:javascript
复制
<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>

希望这能有所帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37122915

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档