How to Create a Deployable Solution Package for SharePoint Feature/WorkFlow
Creating a Manifest.xml File
You must create a Manifest.xml file for your solution package. Open the Visual Studio 2008 project you created in the previous Visual How To: Building an Expense Report Approval Workflow for SharePoint Server 2007 Using Visual Studio 2008.
To create a Manifest.xml file
Add a solution folder to the project.
Select the solution in Solution Explorer.
Right-click the solution, point to Add, and then click New Solution Folder. Rename the folder Solution.
Select the new solution folder.
Right-click the new solution folder, point to Add, click New Item, and then select XML File in the dialog box. Rename the XML file to Manifest.xml. Click Add.
Add the following to the blank XML file.
Xml Copy Code
<?xml version="1.0" encoding="utf-8"?>
<Solution xmlns="http://schemas.microsoft.com/sharepoint/"
SolutionId="B90C9FD7-29F3-477f-A038-B4BA51FE219F">
<FeatureManifests>
<FeatureManifest Location="SSLNotification\feature.xml" />
</FeatureManifests>
<Assemblies>
<Assembly Location="SSLNotification.dll"
DeploymentTarget="GlobalAssemblyCache" />
</Assemblies>
</Solution>
Specifying the DeploymentTarget attribute indicates that you want your DLL to be installed to the global assembly cache when the solution is deployed.
Note:
You can add the Wss.xsd schema to the schemas for this blank XML file. This will provide you with IntelliSense and validation while you are editing the Manifest.xml file.
Creating a Solution.ddf File
Next, you create a Solution.ddf file. This file is used to create your Solution Package. For more information, see the Microsoft Cabinet Software Development Kit.
To create a Solution.ddf file
Select the solution folder that you previously created.
Right-click the folder, point to Add, select New Item, and then select Text file.
Rename the text file Solution.ddf. Click Add.
Add the following to the blank Solution.ddf file.
Copy Code
.OPTION EXPLICIT
.Set CabinetNameTemplate=SSLNotification.wsp
.Set DiskDirectoryTemplate=CDROM
.Set CompressionType=MSZIP
.Set UniqueFiles="ON"
.Set Cabinet=On
.Set DiskDirectory1=.manifest.xml
"SSLNotification\ExpenseReportApprovalForm.xsn"
SSLNotification\ExpenseReportApprovalForm.xsn
"SSLNotification\bin\Debug\SSLNotification.dll"
"SSLNotification\feature.xml"
SSLNotification\feature.xml
"SSLNotification\workflow.xml"
SSLNotification\workflow.xml
Note:
It is important to point out that both the Feature.xml and the Workflow.xml files must be put into a folder inside the solution package file. You do this by separating the source file and the destination with a space and then specifying a folder directory for the destination. "SSLNotification\feature.xml" SSLNotification\feature.xml "SSLNotification\workflow.xml" SSLNotification\workflow.xml Note:
It is also important that you add your Custom Task form to this solution package. "SSLNotification\ExpenseReportApprovalForm.xsn" SSLNotification\ExpenseReportApprovalForm.xsn
Creating the Solution Package
You are now ready to create the solution package. You need the Makecab.exe tool to create the solution package. If you do not have it on your computer, you can find it here: Microsoft Cabinet Software Development Kit.
To create the solution package
Open a command prompt, and navigate to the solution directory.
Run the following command to build the Solution.ddf file:
makecab /f Solution.ddf
You now have a solution package in your solution directory.
Deploying the Solution Package
Now that you have a solution package, you have to deploy it. You must have the Stsadm.exe tool to deploy the solution package.
To deploy the solution package
Open a command prompt and navigate to the directory that contains the Stsadm.exe tool.
Run the following command to add your solution to a SharePoint server.
stsadm.exe -o addsolution -filename [Solution Directory Goes Here]\SSLNotification.wsp
Now that your solution has been added to the SharePoint server, you must deploy that solution. Although you can deploy the solution using the SharePoint Server user interface (UI), you will use the command line in this scenario.
Run the following command:
stsadm.exe -o deploysolution -name SSLNotification.wsp -allowgacdeployment -force -immediate
You now must install your Feature to your site. Run the following command:
stsadm.exe -o installfeature -name "SSLNotification" -force
Now that you have installed your Feature, you must activate it.
Run the following command:
stsadm.exe -o activatefeature -name "SSLNotification" -url http://www.techplanetcanada.com
Comments
Post a Comment