views:

1102

answers:

3

I've already got a NAnt build script that builds/runs tests/zips web project together, etc. but I'm working on a basic desktop application. How would I go about build the setup project using NAnt so I can include it with the build report on TeamCity.

Edit: The setup is the basic Setup Project supplied with Visual Studio. It's for internal to a company so it doesn't do anything fancy.

+3  A: 

The only way to build a Visual Studio setup project is through Visual Studio. You will need to have a copy of VS installed on the build machine and run it as a command line tool (exec devenv.exe) with the appropriate parameters (which should be the build mode (release or debug) and the project name to build, there might be a few others but you can run devenv /? to get a list of the different command line options).

Scott Dorman
Using Visual Studio to build it was a solution I was really wanting to avoid. Think I'll have a look at Wix
Chris Canal
Wix is certainly a good option, but it didn't really answer your question.
Scott Dorman
+1  A: 

It's been a few years, but the last time I had to do this, I used a tool called Wix, which had utilities named Candle and Light. I used these tools in my NAnt script to create an MSI Installer.

Guess this is the answer currently :o(
Chris Canal
A: 

Instead of trying to build using MSBUILD (assumption), build the solution or project using DEVENV.EXE. The command line is something along the lines of:

DEVENV MySolutionFile.sln /build DEBUG /project SetupProject.vdproj

You can change the DEBUG to RELEASE or any other build configuration you've set up. You can also leave out the /project... part to build the whole solution.

Darksider
He's using NAnt not MSBuild, but the same rules apply...the only way to build a .vdproj project is through Visual Studio itself so you have to use the command line.
Scott Dorman