Installing and Activating Feature Definitions

After you create your feature definition and define the necessary feature elements, you need to install the feature so that it is available for activation at the appropriate scope.

Installing the feature

Features are stored at Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES. To install a new feature, create a subdirectory under this feature folder and place your feature.xml file in that folder. The folder can also contain supporting element files and subdirectories. Confirm that you have configured the new directory to inherit permissions from the parent folder so that SharePoint has the appropriate rights to access your feature definition.

Once you have added your feature folder in the appropriate directory, follow these steps to use the Stsadm.exe command-line tool (MS use) to install your feature:

1.
Open a command prompt on your SharePoint server.
2.
Navigate to the <system drive>\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN directory.
3.
Enter the stsadm command with the filename parameter pointing to your feature subdirectory and XML file as follows:
stsadm -o installfeature -filename <featuresubdirectory>\
  feature.xml <ENTER>
This command is shown in Figure 9.5.
Figure 9.5. Adding a feature using the stsadm command
4.
When the command line ...

Get Microsoft® SharePoint® Server 2007 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.