如何使用MSBuild生成Visual Studio安装项目 [英] How to use MSBuild to build a Visual Studio Setup Project
问题描述
我正在尝试使用MSBuild通过以下文章构建Visual Studio安装项目:
I am trying to use MSBuild to build a Visual Studio Setup Project using the article below:
http://msdn.microsoft.com/en-us/library/ms404859.aspx
除了在这种情况下不使用TFS之外,我已经按照上面文章中提到的所有步骤进行操作.
I have followed all the steps mentioned in the article above with the exception of not using TFS in this case.
我试图创建一个Demo.proj文件,而不是使用TFS选项,并且包括以下详细信息: **-Demo.proj **
Instead of using the TFS option, I am trying to create a Demo.proj file and have included the below details: ** - Demo.proj**
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="AfterCompile">
<Exec Command=""$(ProgramFiles)\Microsoft Visual Studio 9.0\Common7\IDE\devenv" "C:\Users\sapatro\Documents\visual studio 2010\Projects\HelloWorldTest\HelloWorldTestInstaller\HelloWorldTestInstaller.vdproj" /Build "Debug|Any CPU""/>
<Copy SourceFiles="C:\Users\sapatro\Documents\visual studio 2010\Projects\HelloWorldTest\HelloWorldTestInstaller\Debug\HelloWorldTestInstaller.msi; C:\Users\sapatro\Documents\visual studio 2010\Projects\HelloWorldTest\HelloWorldTestInstaller\Debug\setup.exe" DestinationFolder="$(OutDir)" />
</Target>
</Project>
现在当我尝试输入cmd提示并尝试以下命令时:
now when I trying to cmd prompt and trying the following command:
msbuild DemoBuild.proj/target:AfterCompile
msbuild DemoBuild.proj /target:AfterCompile
我遇到以下错误:
构建失败.
"C:\ xxxxxxxxx \ Documents \ Visual Studio 2010 \ Projects \ HelloWorldTest \ DemoBuild.proj"(默认目标)(1)-> (AfterCompile目标)-> C:\ xxxxxxxxx \ Visual Studio 2010 \ Projects \ HelloWorldTest \ DemoBuild.proj(4,5):错误MSB3073:命令"C:\ Program Files(x86)\ Microsoft Visual Studio 9.0 \ Common7 \ IDE \ devenv""C:\ xxxxxxxxx \ Documents \ visual studio 2010 \ Projects \ HelloWorldTest \ HelloWorldTestInstaller \ HelloWorldTestInstaller.vdproj"/Build" Debug | Any CPU"退出,代码为1.
"C:\xxxxxxxxx\Documents\Visual Studio 2010\Projects\HelloWorldTest\DemoBuild.proj" (default target) (1) -> (AfterCompile target) -> C:\xxxxxxxxx\Visual Studio 2010\Projects\HelloWorldTest\DemoBuild.proj(4,5): error MSB3073: The command ""C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv" "C:\xxxxxxxxx\Documents\visual studio 2010\Projects\HelloWorldTest\HelloWorldTestInstaller\HelloWorldTestInstaller.vdproj" /Build "Debug|Any CPU"" exited with code 1.
0 Warning(s)
1 Error(s)
经过的时间00:00:01.25
Time Elapsed 00:00:01.25
任何人都可以帮助我解决此问题.
Can anyone help me to resolve this issue.
感谢&问候, Santosh Kumar Patro
Thanks & Regards, Santosh Kumar Patro
推荐答案
这对我有用:
<Exec Command=""$(ProgramFiles)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.com" your.vdproj /build "Debug|AnyCPU""/>
您是否不需要任何cpu中的空间,也需要调用devenv.com,还假设您已存在那些构建配置?
You don't need the space in any cpu and you need to call devenv.com, also assuming you have those build configuration existing?
这篇关于如何使用MSBuild生成Visual Studio安装项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!