Saturday, January 13, 2007

WSS 3.0 unattended setup...

WSS 3.0 totally rocks, and to facilitate faster dev environment provisioning, I whipped up a quick unattended install that y'all might be interested in.

It assumes you have already install IIS and .NET Framework 2.0, and enabled the ASP.NET 2.0 web extension (aspnet_regiis -i -enable). So for the rest, I have an ISO with 2 directories, NETFX30 and WSS30. Then I have the following in a batchfile in the root of the ISO:

@echo off
:: Install .NET Framework 3.0
echo Installing .NET Framework 3.0...
cd NETFX30
start /wait dotnetfx3.exe /q /norestart
:: Install WSS 3.0
echo Installing WSS 3.0...
cd ..\WSS30
xcopy config.xml %WINDIR%
start /wait setup.exe /config %WINDIR%\config.xml
:: Sleep 10 mins
echo Sleeping for 10 mins for WSS config to complete...
sleep 600
:: Reboot
echo Rebooting...
shutdown -r -t 10

And the the config.xml file has the following:

[Package Id="sts"]
[Setting Id="REBOOT" Value="ReallySuppress" /]
[Setting Id="SETUPTYPE" Value="CLEAN_INSTALL" /]
[DATADIR Value="D:\WSSv3\Data" /]
[Logging Type="verbose" Path="%temp%" Template="Microsoft Windows SharePoint Services 3.0 Setup(*).log" /]
[Setting Id="UsingUIInstallMode" Value="0" /]
[Display Level="basic" AcceptEula="yes" CompletionNotice="no" /]

But of course all those square brackets should be angle brackets. And obviously all my boxes have a D: drive. If you already had a farm, you would change the SERVERROLE value to "WFE" (Web Front End).

The unattended setup of WSS 3.0 is pretty horrible... the SQL Embedded instance does a crapload of configuration long after the actual setup completes, hence the 10 minute sleep I have in there. If you reboot before that configuration finishes, the WSS 3 config wizard will give you a world of hurt. If you want to modify it to reboot exactly after the configuration is successful, look for Event ID 101 from source "SharePoint Products and Technologies Configuration Wizard" in the app event log.

But besides that, the product is awesome!