【发布时间】:2015-06-03 13:57:20
【问题描述】:
我正在尝试使用 WiX 和 MSBuild 命令创建我的 MSI 设置,该命令将我的 img.png 部署到一个目录中,但我遇到了这个错误:
"MSB4019: 项目导入"C:\Program Files\MSBuild\Microsoft\WiX\v[[Version.Major]].x\Wix.targets" 不是 成立。 " 确保声明路径正确
在这一行:
<Import Project="$(WixTargetPath)" />
这是我的 2 个文件(test.wixproj 和 test.wxs):
test.wixproj
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.0</ProductVersion>
<ProjectGuid>{}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>WixProject1</OutputName>
<OutputType>Package</OutputType>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v[[Version.Major]].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="C:\testW2.wxs" />
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
</Project>
test.wxs
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" UpgradeCode="" Version="1.0.0.0" Language="1033" Name="My Application Name" Manufacturer="My Manufacturer Name">
<Package InstallerVersion="300" Compressed="yes"/>
<Media Id="1" Cabinet="myapplication.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="APPLICATIONROOTDIRECTORY" Name="Application test"/>
</Directory>
</Directory>
<DirectoryRef Id="APPLICATIONROOTDIRECTORY">
<Component Id="myimg" Guid="">
<File Id="myimg" Source="C:\img.png" KeyPath="yes" Checksum="yes"/>
</Component>
</DirectoryRef>
<Feature Id="MainApplication" Title="Main Application" Level="1">
<ComponentRef Id="myimg" />
</Feature>
</Product>
</Wix>
我不明白问题出在哪里,我找不到没有 VisualStudio 的关于 WiX 的简单教程。
你能帮帮我吗?
【问题讨论】:
标签: msbuild wix installation