How To: Create a SharePoint Solution for an InfoPath Form

Mark Wagner
 
Summary
This post discusses how you can create a SharePoint solution package to deploy an InfoPath form to your SharePoint 2007 farm.  No coding required.
 
Downloads
Overview
InfoPath forms are normally deployed manually using the Manage Form Templates administration tool in Central Administration.  These forms can also be deployed using the STSADM command.  Although both of these methods work perfectly well, they are not always the desired method.
 
Since the release of SharePoint 2007/3.0 there have been a few new utilities that provide an improved and simplified deployment experience.  I have personally created installer classes for use with a packaged .msi file to simplify the process of deploying many SharePoint solution packages at once using the SharePoint 2007 object model.  The problem is that I have been unable to deploy an InfoPath form to SharePoint via the object model.
The result is a quick and simple solution to create your InfoPath form solution packages…   Let SharePoint do it for you.
 
Concept
If you have ever deployed an InfoPath form to SharePoint 2007, you may have also noticed that a new solution package appears in the Solution Management screen.  The name of this mysterious new solution begins with “form-“, followed by something that probably resembles the name of the InfoPath form you installed using the Manage Form Templates administration tool.  Chances are you probably assumed it had something to do with your form but just weren’t sure.
 
The new solution named “form-SOMETHING-NNN” is actually a solution package created by your SharePoint server that contains your new InfoPath form.  This allows your InfoPath form to be deployed and retracted to the web applications of your choice just like any other solution.
 
So, wouldn’t it be nice to see what that package looks like?  Heck, it would be even better if you could use that package to redeploy your form (as a solution package, not as an InfoPath .xsn file) to other SharePoint environments such as your Integration Testing, User Testing, and eventually on to your production environment.  The only question remaining is how do you export that solution package out of your SharePoint farm?
 
This is why I created the SharePoint Solution Exporter tool.
 
SharePoint Solution Exporter
The SharePoint Solution Exporter is a very simple little tool that allows you to export and save any solution installed on your farm to your local disk.  Once you have exported your solution (.wsp) file you can rename it to a more appropriate solution name for easy and clear identification; and you can take that solution and deploy it to another farm.  Here is what the SharePoint Solution Exporter tool looks like:
 
SharePointSolutionExporter
 
You must run this tool locally on your SharePoint web server.  To export a solution package:
  1. Enter the URL to your web server and click the Go button.
  2. A list of installed solutions will appear in the list body.
  3. Select the solution of your choice.
  4. Click the Download Solution File and specify name of your solution file in the Save As dialog.

I hope you find this tool as helpful as I have.

Note: For those of you interested in how to create a SharePoint solution package from scratch using Visual Studio, I hope to post an article soon on how to accomplish that as well.

Advertisements

5 thoughts on “How To: Create a SharePoint Solution for an InfoPath Form

  1. (Migrated Comments from my old blog)

    Great!

    Mark, thanks for creating this. InfoPath form deployment has been a big problem and this utility makes it easy!

    Thanks,
    Ethan Wilansky
    at 2/22/2008 5:25 PM
    Re: Great!

    Thanks Ethan for your comment and a big thanks for mentioning this in your MSDN article in the May 2008 edition.
    at 4/30/2008 10:46 AM
    Nice

    I’m new to InfoPath and was wondering this too. Well… this is a clear answer! Thank you.
    at 5/6/2008 1:25 PM
    More info for you

    Hi!

    I created a small windows application that I could use to deploy about 5 InfoPath forms to my local MOSS dev server. Look at the namespace: Microsoft.Office.InfoPath.Server.Administration

    Specifically:
    FormTemplates.UploadFormTemplate() methods

    Let me know if you want me to post some of my code.

    Jason
    at 5/9/2008 5:03 PM
    Re: More info for you

    Jason, I would be interested in what you have to share?
    Mark at 5/12/2008 12:28 PM
    Re: How To: Create a SharePoint Solution for an InfoPath Form

    Hi Mark,

    Great tool. Very good idea :). I’d be very interested if you could explain us how to create a solution file from scratch embedding our form templates using Visual Studio
    at 6/27/2008 12:39 PM
    is this a bug?

    Hi Mark,

    I have one infopath form that i have deployed. The form now is running as expected. However when i am trying to “export” the .wsp using your tool, i can’t find the file nor find it in solution management file.

    is this a bug or i have deployed my form incorrectly?
    Thanks
    at 7/15/2008 5:47 PM
    How to check Solution Name?

    Hi Mark,

    I am not sure to select my solution from solution list in Solution Exportor. Because when I deployed InfoPath Form to the server, I use Central Admin to deploy my form (Manage Form Template section).

    How can I choose correctly my Solution from solution list in Solution Exportor?

    Thank you very much
    at 9/5/2008 3:32 AM
    Ask for more feature

    Hi Mark,

    I want to know, if I want to include automatic creation new site in this solution file when I deploy. How can I do it?

    Thank you
    at 9/8/2008 3:41 AM
    Re: How to check Solution Name?

    The easiest way to determine which solution contains your forms is to:
    1) Start the Solution Exporter before you add the your new form to SharePoint.
    2) Using a peice of paper, note the solutions that start with “forms-“.
    3) Then, add your form to SharePoint using the Manage Form Templates.
    4) Now, refresh the list of solutions in the Solution Exporter list. Your new form will be the newly created solution that begins with “form-“; the only form missing from your hand-written list.
    Mark at 9/9/2008 8:29 PM
    Very nice

    Hi Mark
    Just used your tool. Worked like a charm for the purpose I had :)
    Cheers
    /Martin
    at 5/11/2009 2:48 AM
    Thanks!

    Thanks a lot for the tool, Mark!

    Sreeja
    at 5/22/2009 7:07 AM
    Re: How To: Create a SharePoint Solution for an InfoPath Form

    ..useful post…thx
    at 8/25/2009 2:49 AM

  2. Pingback: I’m mentioned (twice) in an MSDN Magazine article – SWEET! « Mark Wagner's Cogitation Blog

  3. Hi I just came to your blog is very interesting tool to export the solution.
    There is a way to link to download this tool and I need to extract a WSP for the site and do not have installers.

    Thanks in advance
    CperezQ

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s