在命令行针对 .vdproj 运行 devenv 不会生成 MSI

发布于 2024-09-02 01:51:16 字数 166 浏览 10 评论 0原文

我想在命令提示符下使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

沙沙粒小 2024-09-09 01:51:16

这通常是(根据我的经验!)由于没有针对正确的构建配置而引起的。在 Visual Studio 中,在解决方案级别,您可以转到构建菜单并选择配置管理器。确保对于所有适用的配置(通过活动解决方案配置下拉列表选择),安装程序项目在构建列中都有勾号。

现在,您需要确保在调用 devenv 时传递适当的构建配置(即为安装项目勾选了 Build 的配置),如下所示:

C:\PathToVisualStudio\devenv.exe /Rebuild Release C:\PathToProject\ProjectName.sln" /Out "PathToProject\vs_errors.txt"

(在此示例中,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 choose Configuration Manager. Ensure that for all applicable configurations (chosen via the Active Solution Configuration drop-down) the installer project has a tick in the Build 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:

C:\PathToVisualStudio\devenv.exe /Rebuild Release C:\PathToProject\ProjectName.sln" /Out "PathToProject\vs_errors.txt"

(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.

北城挽邺 2024-09-09 01:51:16

上面的脚本对我有用,请尝试一下,然后告诉我它是否适合您。您几乎可以进行任何配置。我使用过Release|x86。只需用您的配置替换该行即可。确保您使用的任何配置都存在于 .sln 文件或 .csproj 文件中,否则您可能会收到一些有关无效配置的错误。希望这有帮助。

<target name="BuildMsi">
    <echo message="Creating installables (.msi) for MyTestApplication, please wait..."/>    
    <exec program="c:\program files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe">
        <arg value="c:\My app\My_Test_solution.sln"/>
        <arg value="/build"/>
        <arg value="Release|x86" />
        <arg value="/project"/>
        <arg value="c:\My app\setup\My_Test_solution.vdproj"/>
    </exec>
</target>

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.

<target name="BuildMsi">
    <echo message="Creating installables (.msi) for MyTestApplication, please wait..."/>    
    <exec program="c:\program files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe">
        <arg value="c:\My app\My_Test_solution.sln"/>
        <arg value="/build"/>
        <arg value="Release|x86" />
        <arg value="/project"/>
        <arg value="c:\My app\setup\My_Test_solution.vdproj"/>
    </exec>
</target>
痴情换悲伤 2024-09-09 01:51:16

我的情况是一样的,用 /project 给出项目名称有助于生成 .msi 文件,

devenv /build Release /project SDK-Deployment SDK-Deployment.vdproj

My case was the same, and giving the project name with /project helped with .msi file generation,

devenv /build Release /project SDK-Deployment SDK-Deployment.vdproj
一个人练习一个人 2024-09-09 01:51:16

我不认为 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文