views:

668

answers:

5

I've noticed projects such as Msbuild Extension Pack and MsBuild Community Tasks give msbuild the power to install assemblies, sql, and setup IIS. These features seem to be oriented to doing installs and not builds.

So I was wondering how many people out there are using msbuild, perhaps in conjunction with Cruise Control.Net to do installs on staging environments?

+3  A: 

I use MsBuild to build, and part of the build process runs Wix to create an installer(MSI) which is used to deploy to production.

Jesse Weigert
+1  A: 

We use CC.NET & MSBuild to build and then also to publish to our dev and stage environments, however we do not have the push live on CruiseControl.NET, we run that MSBuild by hand. We just thought it would be way to tempting with a button to publish live ;) It took probably 2 or 3 revisions to get our MSBuild set up right. But now everything is in one file, and everything is based on Targets and Properties to do all the work. About 6 months ago, was what should be the last update and that was a multi-server push so we are ready for scaling up. We can now push any combination of parts to any combination of servers. So if we want 5 database servers, 3 contenet servers, and 2 web servers we have that ability. No need to use anything else. MSBuild can do it.

Alex
Are you running CC.Net on your staging environment?
Ryu
Not on it, but it publishes to the stage environment using MSBuild.
Alex
Are you just publishing a web site, or do you need to install to you gac or do anything else?
Ryu
I need to publish websites, install services, gac, register com + and I was considering just putting CC.Net on staging servers. However I never hear about people using cc.net + msbuild for installs. It makes sense to me, maybe im just a trail blazer?
Ryu
We Update Databases, publish web sites, and install a few services and we do this all with MSBuild.
Alex
How do you install services on a remote machine with Msbuild?
Ryu
The first project we build is a little C# app that uses System.ServiceProcess. This app is then called later in the MSBuild with parameters <Machine> <Service> <Start/Stop> and it handles it.
Alex
I've seen other projects which take a similar approach to yours. It depends how involved the install is. If it is simple then MSBuild is good. WiX is a good choice for creating MSIs if you find that you need that.
Sayed Ibrahim Hashimi
A: 

I use MSBuild to build a fairly large client/server application. I use InstallShield 2008 to create a separate client and server install set.

By adding a custom target into the build process you can combine the creation of the installers into the build.

I would recommend that you create and test the build and the installer separately, before attempting to integrate the two.

madman1969
+1  A: 

I created a deployment system where a central coordinator can:

- identify the right target server for a given component (e.g Windows service goes to a given server, web services go to another, etc.)
- perform a PsExec of a deployment MSBuild script on the target server
- the deployment MSBuild script is responsible for:
    a) downloading the right component package (in my case a .zip)
    b) backing up previous versions of the component
    c) extracting the package to the right place
    d) tailoring the installation steps to the type of component to deploy (e.g. needs to perform an Exec task of installutil.exe on a Windows service )
    e) logging the result of the deployment

This system is built using a mix of:

- core MSBuild tasks
- [Tigris MSBuild community tasks][1]
- [MS SDC tasks][2]
- and custom tasks

The system allows us to perform consistent deployment of complex apps across partitioned environments (e.g. DEV, QA, UAT, etc) made of virtual servers.

Philippe Monnet
+1  A: 

I wrote up a little sample of templating configurations for different target environments with msbuild: http://blog.privosoft.com/2010/10/msbuild-environment-sandboxing.html

Thanks for sharing your work, a lot of build masters should find it useful!
Ryu