Building a setup project from bat file

2019-08-11 00:11发布

I want to build a setup project using a bat file and want to generate msi. I tried building using MSBuild.exe like below

@echo off
call %windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe C:\Setup1\Setup1.sln

But it seems MSBUILD doesn't support setup projects. Is there any other idea to build the setup project using bat file?

3条回答
仙女界的扛把子
2楼-- · 2019-08-11 00:45

You can build installer projects in msbuild if you wrap the devenv with the exec target:http://thepursuitofalife.com/how-to-build-vdproj-files-in-msbuild/

查看更多
你好瞎i
3楼-- · 2019-08-11 00:50

You can set the Visual Studio output to verbose, build an Installation project and check the output to see what VS does to do the same (I haven't installation projects here to do it by myself, sorry).

查看更多
兄弟一词,经得起流年.
4楼-- · 2019-08-11 01:00

Devnev is what you're after.

The following command builds setup project Setup1 in C:\Setup1\Setup1.sln in release configuration:

>devenv C:\Setup1\Setup1.sln /build Release /project Setup1

Or you can build it directly:

>devenv C:\Setup1\Setup1\Setup1.vdproj /build Release 
查看更多
登录 后发表回答