1

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?

Jeff LaFay
  • 12,882
  • 13
  • 71
  • 101
Bhaskar
  • 1,680
  • 7
  • 26
  • 40

3 Answers3

5

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 
KMoraz
  • 14,004
  • 3
  • 49
  • 82
2

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/

James Woolfenden
  • 6,498
  • 33
  • 53
  • Link is outdated, this one could help though http://stackoverflow.com/questions/18512015/how-to-use-msbuild-to-build-a-visual-studio-setup-project – CamHart Jan 14 '16 at 20:49
0

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

Ignacio Soler Garcia
  • 21,122
  • 31
  • 128
  • 207