Friday, November 18, 2011

Creating a Solution Package in Windows SharePoint

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.

<Solution SolutionId="44BE5F4A-D561-4981-A318-95ABC706364A" 
          xmlns="http://schemas.microsoft.com/sharepoint/">
  <FeatureManifests>
    <FeatureManifest Location="ItemAuditing\feature.xml" />
  </FeatureManifests>
  <TemplateFiles>
    <TemplateFile Location="LAYOUTS\AuditLogViewer.aspx"/>
    <TemplateFile Location="LAYOUTS\ItemAudit.aspx"/>
    <TemplateFile Location="LAYOUTS\AuditLogWorkbook.ashx"/>
  </TemplateFiles>
  <Assemblies>
    <Assembly DeploymentTarget="GlobalAssemblyCache" 
              Location="ItemAuditing.dll" />
  </Assemblies>
</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


No comments:

Post a Comment

Thank you for Commenting Will reply soon ......

Featured Posts

Open Hardware Monitor A Handy Tool for System Monitoring

#Open #Hardware #Monitor: A Handy Tool for #System #Monitoring #OpenHardwareMonitor is a free, #opensource #software designed to monitor t...