Saturday, November 19, 2011

The easiest way to package and deploy a Sharepoint workflow

Note: this relates to packaging up MOSS 2007 workflows created in Visual Studio.

If you have developed your workflow in Visual Studio and have already been F5 deploying it (which means you have already created your feature.xml and workflow.xml), and now you are ready to package it up into a wsp for deploying to other servers, then the following is probably the quickest way of doing that.

Essentially, it involves using WSP Builder. However, this method doesn't require using any of the WSP Builder project templates to do it. The templates are useful if you create your workflow project from the WSP Builder templates to begin with. But if you created your workflow with the normal Visual Studio workflow templates, THEN want to use WSP Builder templates for packaging the workflow, its a bit of a pain to do. This will enable you to get your .wsp with the absolute minimum in changes to your Visual Studio project.

1. install WSP Builder, then load Visual Studio and your workflow project

2. in your Project, create 12/TEMPLATE/FEATURES/your_feature_name

3. copy feature.xml, workflow.xml, and your InfoPath task forms (.xsn's) into this folder

4. right-click your project, click WSPBuilder -> Build WSP

WSP Builder will automatically
1. build your manifest.xml for you, adding in everything it sees in your 12 folder structure
2. get your project's assembly (.dll)
3. package it all into a .wsp file and drop it in the root of your project


Below are my installation and removal scripts.


rem Workflow installation script

d:\stsadm -o addsolution -filename d:\deploy\MyWorkflowProject\MyWorkflowProject.wsp

d:\stsadm -o deploysolution -name MyWorkflowProject.wsp -immediate -allowGacDeployment

pause

d:\stsadm -o activatefeature -name MyWorkflowProject -url http://server_to_deploy_to



rem Workflow removal script

d:\stsadm -o deactivatefeature -name MyWorkflowProject -url http://server_to_deploy_to

d:\stsadm -o retractsolution -name MyWorkflowProject.wsp -immediate

pause

d:\stsadm -o deletesolution -name MyWorkflowProject.wsp -override

No comments:

Post a Comment