Creating a Solution Package in Windows SharePoint Services 3.0

Applies to:  Microsoft Windows SharePoint Services 3.0, Microsoft Office SharePoint Server 2007, Microsoft Visual Studio 2005

Ted Pattison, Critical Path Training

May 2007

Microsoft Windows SharePoint Services 3.0 introduces a deployment mechanism named "solution packages." A solution package is a CAB file with a .wsp file-name extension that contains all the files that must be deployed on the front-end Web server and a set of XML-based installation instructions. Windows SharePoint Services provides a rich infrastructure that simplifies deployment of solution packages in a Web farm environment.

Each solution package must contain a header file named manifest.xml that defines a Solution element. The following manifest.xml file has been created for the Item Auditing solution.

Building the CAB File for a Solution Package

As you see, the manifest.xml file defines which files are parts of the solution that must be deployed on the front-end Web server. After you define the manifest.xml file, compile it into a CAB file with all the other required files. You can do this by using the MAKECAB.EXE command-line utility. When you use this tool, you must define a .ddf file that instructs MAKECAB.EXE which files to include in the output CAB file. Here is an example of a file named cab.ddf file used for building the ItemAuditing.wsp package file for the Item Auditing solution.

.OPTION EXPLICIT ; Generate errors 
.Set CabinetNameTemplate=ItemAuditing.wsp     
.Set DiskDirectoryTemplate=CDROM ; All cabinets go in single directory
.Set CompressionType=MSZIP ; All files compressed in cabinet files
.Set UniqueFiles="ON"
.Set Cabinet=on
.Set DiskDirectory1=Package
Solution\manifest.xml manifest.xml
TEMPLATE\FEATURES\ItemAuditing\feature.xml ItemAuditing\feature.xml
TEMPLATE\FEATURES\ItemAuditing\elements.xml ItemAuditing\elements.xml
TEMPLATE\LAYOUTS\AuditLogViewer.aspx LAYOUTS\AuditLogViewer.aspx
TEMPLATE\LAYOUTS\ItemAudit.aspx LAYOUTS\ItemAudit.aspx
TEMPLATE\LAYOUTS\AuditLogWorkbook.ashx LAYOUTS\AuditLogWorkbook.ashx
bin\Debug\ItemAuditing.dll ItemAuditing.dll

Running MAKECAB.EXE

After you define the .ddf file, you can run the following command-line instruction to build the .wsp package solution file.

makecab /f Solution\cab.ddf

Because you can deploy SharePoint solutions on Windows SharePoint Services or Microsoft Office SharePoint Server installations that range in size from a single, stand-alone Web server to large enterprise server farms, there must be a mechanism to deploy them as a single unit. By deploying a single unit, we can have a supported, testable, and repeatable deployment mechanism. The deployment mechanism that SharePoint Products and Technologies use is the solution package.

Solution packages are critical components for deployment in enterprise or commercial scenarios, and use the same Microsoft Visual Studio project formats you use in your development environment. For all deployments outside your development environment, use solution packages. Solution packages also enable your system administrators to create scriptable installations, an important requirement for many enterprise-class IT organizations.

Watch the Video

Length: 9:54 | Size: 26.3 MB | Type: WMV