In a previous post I talked about Features in MOSS 2007 and WSS 3.0 - these are a very powerful framework to extend your SharePoint platform. But at a certain point you will still need to deploy these features to your SharePoint servers (be it a single server or a complete web farm).
The best way to do this, is to create a SharePoint solution file - this is basically a cabinet file with the wsp extension. This WSP file can be used to deploy web parts, template files, assemblies, code access security policies, site definitions or features.
To create a solution file you will need to create:
- A manifest.xml file to specify what needs to happen
- A DDF ( data directive) file which tells makecab.exe how to structure your cabinet file. You will need to use makecab since you will need a folder structure within your cabinet file (similar to the structure you will need underneath the "12" hive.
In the previous post about features - I pointed to a nice example of how you can change the Site Actions menu with a feature - here you can download a solution which includes a wsp file. If you rename the wsp file to cab and extract the manifest.xml file you get the contents listed below.
<?xml version="1.0" encoding="utf-8" ?>
<SafeControl Assembly="SiteActionsSubMenuDemo, Version=184.108.40.206, Culture=neutral, PublicKeyToken=e9db3057acd9c0f6"
After you have created the solution, you will need to deploy it to the solution store which is a central location for all solution files. After you have deployed the solution to a single server, the SPTimer service will synchronise/deploy the solution automatically to the other servers in the farm.
- Add solution: stsadm.exe -o addsolution -filename "solutionname.wsp"
- Deploy solution - either from SharePoint Central Administration > Go to the Operations Tab - underneath the Global Configuration category you will see Solutions Management.
After you have deployed a solution you can still remove it - this action is called retracting. You can start retraction from the command line through stsadm.exe, from within SharePoint Central Admin or with the object model (Microsoft.SharePoint.Administration.SPSolution.Retract)