在命令行针对 .vdproj 运行 devenv 不会生成 MSI
我想在命令提示符下使用 devenv
命令从 .vdproj
文件生成 MSI 文件。该命令运行良好,但未生成 MSI 文件。怎么了?
我应该在环境变量中设置什么,或者是否有其他方法可以从 .vdproj
文件生成 MSI?
I want to generate MSI files from a .vdproj
file using the devenv
command in a command prompt. This command is running well but no MSI file is generated. What is wrong?
What should I set in environment variables, or is there any other way to generate an MSI from a .vdproj
file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这通常是(根据我的经验!)由于没有针对正确的构建配置而引起的。在 Visual Studio 中,在解决方案级别,您可以转到
构建
菜单并选择配置管理器
。确保对于所有适用的配置(通过活动解决方案配置
下拉列表选择),安装程序项目在构建
列中都有勾号。现在,您需要确保在调用 devenv 时传递适当的构建配置(即为安装项目勾选了
Build
的配置),如下所示:(在此示例中,
Release
是我的目标构建配置)此命令还将 Visual Studio 的输出记录到与您的解决方案位于同一文件夹中的名为
vs_errors.txt
的文本文件中,以便您可以查看此内容以确定是否还有其他原因导致安装项目构建失败。This is usually (in my experience!) caused by not targeting the correct build configuration. Within Visual Studio, at the solution level you can go to the
Build
menu and chooseConfiguration Manager
. Ensure that for all applicable configurations (chosen via theActive Solution Configuration
drop-down) the installer project has a tick in theBuild
column.Now you need to ensure that when invoking devenv you're passing the appropriate build configuration (i.e. one that has
Build
ticked for the setup project) as follows:(In this example,
Release
is the build configuration I'm targeting)This command also logs the output of Visual Studio to a text file called
vs_errors.txt
in the same folder as your solution so you can review this to determine if there are any other reasons why the setup project failed to build.上面的脚本对我有用,请尝试一下,然后告诉我它是否适合您。您几乎可以进行任何配置。我使用过
Release|x86
。只需用您的配置替换该行即可。确保您使用的任何配置都存在于.sln
文件或.csproj
文件中,否则您可能会收到一些有关无效配置的错误。希望这有帮助。Above script worked for me, try it and let me know if it works for you. You can pretty much have any configuration. I have used
Release|x86
. Just replace that line with your configuration and it should work. Make sure that whatever configuration you use exists in.sln
file or.csproj
file, otherwise you may get some error about invalid configuration. Hope this helps.我的情况是一样的,用 /project 给出项目名称有助于生成 .msi 文件,
My case was the same, and giving the project name with /project helped with .msi file generation,
我不认为 msi 会从 devenv.com 生成,您可以选择 wix 和 nant 来创建安装程序。
Nant有一个任务,msi任务,但它需要micrsoft Cabinet sdk,该sdk不提供下载。
阅读此内容以获取更多详细信息 从 .vdproj 构建没有 Devenv 的合并模块
ps如果您找到另一种构建安装程序的方法,请分享。
I don't think that msi will be genereated from devenv.com , you may choose wix with nant to create installer.
Nant has a task, msi task but it requires micrsoft cabinet sdk, which is not available for download.
read this for more details Build merge module without Devenv from .vdproj
p.s. If you find another way to build the installer , please share.