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...
echo.
cd NETFX30
start /wait dotnetfx3.exe /q /norestart
::
:: Install WSS 3.0
echo Installing WSS 3.0...
echo.
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...
echo.
sleep 600
::
:: Reboot
echo Rebooting...
echo.
shutdown -r -t 10


And the the config.xml file has the following:

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


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!