Wednesday, September 16, 2009

Automating MOSS 2007 installs

Let’s build onto the process described in my last post. This time, let’s look at automating the setup of MOSS 2007. Here is a link which describes the process for “slipstreaming” the MOSS setup files with SP1; therefore, I’m going to skip that. Apparently, the Product Group has released a downloadable version also, so this might be useful for future service packs and updates.

Depending on where you want to go, if you still need to install SQL…you can bolt this process right on top of the unattended SQL installation procedure. For me, this comes in handy when re-building my farm(s) for development.

The pre-requisites for installing MOSS 2007 on Windows 2008 are to install the web server role w/ the IIS6 management components. You can do this by using servermanagercmd.exe with the –I switch + the [Web-WebServer] and [Web-Mgmt-Compat] components. For example:

servermanagercmd -i Web-WebServer

servermanagercmd -i Web-Mgmt-Compat

Assuming SQL is already provisioned and you have a slipstreamed install directory, you can proceed to setup a configuration file for setup. Be sure to install the pre-requisites, then you can proceed to use the /config [path and file name] switch to reference a Config.xml file to setup MOSS 2007. If you’ve slipstreamed your installation files with SP1, the updates will be applied during the installation. Here is the TechNet link on how to use the Config.xml for controlling installs or doing more advanced installations.

Below is a sample configuration file I use for simple farm installation, using the following syntax:

\\..\...\MOSS2007_FullSP1\x86Setup\setup.exe /config “config.xml”

- <Configuration>

- <Package Id="sts">

<Setting Id="LAUNCHEDFROMSETUPSTS" Value="Yes" />

<Setting Id="REBOOT" Value="ReallySuppress" />

<Setting Id="SETUPTYPE" Value="CLEAN_INSTALL" />

</Package>

- <Package Id="spswfe">

<Setting Id="SETUPCALLED" Value="1" />

<Setting Id="REBOOT" Value="ReallySuppress" />

<Setting Id="OFFICESERVERPREMIUM" Value="1" />

</Package>

<DATADIR Value="C:\Data" />

<Logging Type="verbose" Path="%temp%" Template="Office Server Setup(*).log" />

<Display Level="none" CompletionNotice="Yes" SupressModal="Yes" AcceptEULA="Yes" />

<PIDKEY Value="XXXXX- XXXXX - XXXXX - XXXXX - XXXXX " />

<Setting Id="SERVERROLE" Value="APPLICATION" />

<Setting Id="USINGUIINSTALLMODE" Value="0" />

</Configuration>

Automating SQL 2008 w/SP1 installs

Building customer solutions can require the maintenance of many development environments; therefore, I’d rather not be spending my whole day doing watching the progress bar of some app install. In addition, each development environment may differ slightly in configuration; therefore I need the ability to just point and click for installs, yet I still need to provide the flexibility to change the installation configuration when needed. There are many ways to do this…I know folks that have built elaborate deployment tools that leverage either SQL or XML to get configurations; however here are some ideas for how I do things using syspreped VM images. This process can easily be packaged and integrated into a nice automated build process using something like SCCM.

Slipstreaming Source Installation Binaries: Installing prerequisite software is a pain, especially if you have to go back around and patch or apply a service pack. As a best practice, it is always best to build using the “most current” advertisements and patches. We all know, applying patches is something that won’t go away, however if I can reduce my deployment time by merging service packs (which always take long), I can make my process more efficient. Here is a post that provides the steps for slipstreaming SQL 2008 with SP1.

Unattended Installation: Unattended installations methods provide value from automation, in addition to insuring consistency in the configuration of a system. For example, say I’m deploying across many systems such as a web farm. I’d want the build automated versus going to each machine. SQL 2008 supports unattended installs by using a configuration file. This configuration file provides the ability to deploy SQL throughout the enterprise with the same configurations. Here is the MSDN link which covers installing SQL using configuration files.

How To: Create an installation directory to store the source installation files. Within that directory, you can store any pre-requisites. For example, mine is: \\XXX.XXX.XXX.XXX\Source\SQLServer2008Ent_FullSP1\Soruce

Within the pre-requisites directory (\\XXX.XXX.XXX.XXX\Source\SQLServer2008Ent_FullSP1\Pre-Req), I keep the following support files:

  1. .NET 3.5 SP1 (Full)
  2. KB959209 (Updates for .NET 3.5 SP1)
  3. Windows 4.5 Installer

The installation directory (\\XXX.XXX.XXX.XXX\Source\SQLServer2008Ent_FullSP1\Setup) maintains:

  1. Installation Files
  2. Configuration File (ConfigurationFile.ini) 

The following commands can be wrapped up into a batch file or installation package to be executed by the installation process.

  1. dotnetfx35.exe /qb /norestart
  2. NDP35SP1-KB958484-x86.exe /q /v /norestart
  3. wusa Windows6.0-KB942288-v2-x86.msu /quiet (will require reboot)
  4. setup.exe /SQLSVCPASSWORD="********" /AGTSVCPASSWORD="********" /ConfigurationFile="%Path to ConfigurationFile.INI%"