Build a Web Setup Project using devenv to Create an MSI

I was disappointed when I learned that you still could not build a Web Setup Project vdproj file using MSBuild. However, you can still use devenv.exe on the commandline to build a project and create an MSI file (try devenv /? for more details). Remember to pass the solution file to devenv first, followed by the vdproj file:
@Echo Off
cd "c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE"
REM Build web setup MSI to Debug
devenv "C:\Dev\MvcWebApplication1\MvcWebApplication1.sln" /build Debug /project "C:\Dev\MvcWebApplication1\MvcWebSetup1\MvcWebSetup1.vdproj" > "C:\Dev\MvcWebApplication1\MvcWebSetup1\MvcWebSetup1.vdproj.log"
REM Move the deployment files 
echo F | xcopy /F /Y /R "C:\Dev\MvcWebApplication1\MvcWebSetup1\Debug\TestMvcWebSetup.msi" "\\releases\Dev\TestMvcWebSetup.msi\TestMvcWebSetup.msi"
I found a great article on adding a Web Setup Project to a solution here: http://dataerror.blogspot.in/2010/06/creating-web-setup-project-for-aspnet.html

Leave a Reply