Bhaskar
Bhaskar

Reputation: 1700

Building a setup project from bat file

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?

Upvotes: 1

Views: 3295

Answers (3)

KMoraz
KMoraz

Reputation: 14164

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 

Upvotes: 5

James Woolfenden
James Woolfenden

Reputation: 6681

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/

Upvotes: 2

Ignacio Soler Garcia
Ignacio Soler Garcia

Reputation: 21855

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

Upvotes: 0

Related Questions