Deploying InfoPath forms Using Features – the Right Way
Posted by kusek on September 19, 2008
” This Post has been moved to my New Blog Please visit http://blog.ksenthil.net/archive/2009/07/25/deployment-of-infopath-form-e28093-the-right-way.aspx“
A week back couple of my friends was asking is there a proper way to deploy the InfoPath forms to the server, Way other than File -> Publish – > SharePoint server with or without forms server. I did a quick search and was not lucky, came to a lackadaisical conclusion that there is no other way. But whenever I deploy workflows with InfoPath form I see a new solution that adds itself to the Solution Store. By this I know for sure there is some other way to deploy InfoPath forms. First thing want I wanted was to get the Solution out of SharePoint and see what’s there inside, Again for this there is a tool through which you can do it [I lost the url from where I got it] or hardly 10 lines of code is all what you need.
To my surprise there is indeed a way to do it, well let’s see how. What I got out of that solution is a feature, what’s in it [Image speaks louder than words, image with comments even louder
] ]
Feature.xml
Element.xml
################### You are Right its again another File Provisioning in to SharePoint Lib #####################
############# Be sure to put the location as FormServerTemplates############
Here is the Stripped Out Version of the XML.

Steps in Short:
- Develop your IP form.
- Publish it to the network location as how you do to upload to the Central Administration Upload Form Templates.
- Create one Feature.xml, Element.xml as defined in the article [Sorry how workflow does
]. - Put in the IP form and create a feature out of it.
- Its all.


skurocks said
Mr.Kurt has Left the Folloing comment, by mistake I have deleted his comments.Sorry Kurt.
The “solution” created by uploading via central admin, then using stsadmin to upgrade the form when it is revised preserves every version of the form (and accompanying DLL if using VSTA) in the WSP. Presumably this is so when an old XML containing data is loaded, it will load in the version of the form it was created with. That is just conjecture though, I’ve not proven it, or researched if that is the intention. For an illustration, use the following article and take a look at the WSP contents.
http://www.crsw.com/mark/Lists/Posts/Post.aspx?ID=37
So I guess the question is: is doing it this way somehow “loosing” the “version tracking” that I’m imagining?
Kurt
Senthil said
Hi Kurt,
If I understood your comment right, you mean to say that if we are using solution way of deploying the InfoPath form, we will have a version tracking such that all the previous version of forms will be accessible as well.
• I am unsure is there a way to get the Older Version of Solution ?
• Also when I try to upgrade a solution with the new version and retract it later it will not step down to the previous version.
• By this if we follow the approach of Solution deployment we will not be able to get the versions tracked.
Thanks & Regards
Senthil
Kurt said
Indeed, I’m pretty sure I was wrong with my guess. I was just confused by the fact that if you stsadm –o upgradeformtemplate , the WSP that is produced contains every version of the form published. I used the WSP exporter from the link to prove this.
That made me think SharePoint was doing something cool with the forms. I though the template deployed in a site collection’s template library would have versions, and that the XML data would somehow know which version it was produced with. But that was wishful thinking, not fact.
Thanks for your reply.
Kurt