SharePoint User Group UK

Share the knowledge!

Welcome to SharePoint User Group UK Sign in | Join | Help
in
Home Blogs Forums Photos Files Roller

How to automate WSP file creation?

Last post 11-07-2008, 2:05 PM by dhunter. 10 replies.
Sort Posts: Previous Next
  •  08-09-2007, 8:12 AM 4715

    How to automate WSP file creation?

    Hi,

    I am using VS.NET 2005 ext. for WSS.

    When I add new project it gives option to "Deploy". This creates .wsp file and deploys to site.

    I want to do first part i.e create wsp file only. Is it possible some how?

  •  08-09-2007, 9:25 AM 4716 in reply to 4715

    Re: How to automate WSP file creation?

    Hi Kalpesh,

    I am writing a short article which talks about the build process I use. I think it will answer your question but unfortunately it's not finished yet! I'll post it on my Blog soon http://www.chrishines.com/techblog

    You should take a look at Andrew Connell's Blog post about creating WSPs with MakeCab.exe 

    http://www.andrewconnell.com/blog/articles/UsingVisualStudioAndMsBuildToCreateWssSolutions.aspx

    Chris Hines


    http://www.chrishines.com/techblog
  •  08-09-2007, 9:38 AM 4717 in reply to 4716

    Re: How to automate WSP file creation?

    Kalpesh,

    Don't forget that the .wsp file which VSeWSS has generated can then also be copied to other SharePoint environments and deployed there. You can use the setup.bat file which VSeWSS also creates (modifying the URLs in the script) to do the actual deployment.

    If you want to understand more about what VSeWSS is doing in this process, and therefore how to build .wsp files 'manually', I wrote about this at Building and Deploying SharePoint Solution packages.

    HTH,

    Chris.
    http://sharepointnutsandbolts.blogspot.com

  •  08-09-2007, 9:45 AM 4718 in reply to 4717

    Re: How to automate WSP file creation?

    Thanks Chris,

    I am aware of that. But changing the site URL will deploy to that site and that I do not want!

    I wants to create only WSP file out of it.

    Just to make more clear, my dev. environment is setup as one VS.NET solution.

    In Solution there are two projects

    1) List Definition project

    2) Web Part Project.

    What is want to do is create wsp file for each project and deploy it.

    Other better way for me is create one wsp for two project.

    Not sure what is possible and how?

  •  08-09-2007, 9:49 AM 4719 in reply to 4717

    Re: How to automate WSP file creation?

    Back Jan/Feb time I looked in to using the VSeWSS and was really put off. I think they were still in Community Release around that time so they may have improved. However, I found them to be really buggy and felt like I had little control over the WSP being generated and the names of Features etc. Hence, we went the "manual" route for generating our WSPs..... I would go with the manual route which chrisob talks about on his Blog.

    Chris Hines


    http://www.chrishines.com/techblog
  •  08-09-2007, 10:02 AM 4720 in reply to 4719

    Re: How to automate WSP file creation?

    Chris your are right. there are lots of problems.

    Before going for manual, I am wondering where we can use /deploy switch of devenv.exe to do this? Provided it does not deploy to site but just create .wsp file.

    I mean can't we use portion of this functionality some how? Programetically or add-in or something else?

  •  08-09-2007, 5:20 PM 4743 in reply to 4720

    Re: How to automate WSP file creation?

    Kalpesh,

    I don't think there's any place you can instruct VSeWSS to do the build but not deploy it to the local server. This is because the setup.bat is generated on each 'compile' (so it's not possible to modify it) and there's no way to pass different parameters to the script. Additionally, it's not possible to not specify a 'Start action' URL in the VS project properties, in the hope that this will build the Solution but not deploy it locally.

    So if you just want to create the package but not deploy it to the local development box (not 100% sure why this would be a problem but..), I think you need to create the Solution manually.

    HTH,

    Chris.
    http://sharepointnutsandbolts.blogspot.com

  •  08-09-2007, 7:57 PM 4747 in reply to 4743

    Re: How to automate WSP file creation?

    Hi,

    I use the SharePoint Visual Studio Project Templates on CodePlex http://www.codeplex.com/sptemplateland.  You need to copy the zipped files to "My Documents\Visual Studio 2005\Templates\ProjectTemplates".  This gives you a new project template for SharePoint Deployment.  It contains the general structure for deploying images, features, site definitions and all files that need to be deployed to the 12 folder.  It also supports writing SafeControl entries and GAC deployment.

    You will see two VBScript files (.vbs extension).  One for creating the manifest file and one for creating the DDF file.  The manifest file informs SharePoint where to deploy the files / assemblies and any CAS policies etc.  The DDF file is used by makecab.exe.  The DDF lists the folders and files that need to be part of the CAB file.  Once the CAB has been created you can rename and deploy using STSADM.

    The reason why I like this process is you can do as much or as little as you want with the solution deployment.  You could automate the manifest file, but hand code the DDF.  I hand coded the DDF a few times to make sure I had the correct values and to learn the structure.  Now I usually just vet the files.

    I made some changes to the create ddf script.  I use VSS (source safe) so I have some files in the root of the project that I dont want including in the package, I modified the script to ignore these file extensions.  The second modifcation was to change the output file extension to .wsp ... saved me a renaming the file everytime I ran makecab.exe.

    This process is the same as Andrew's post http://www.andrewconnell.com/blog/articles/UsingVisualStudioAndMsBuildToCreateWssSolutions.aspx but allows the automation of the manifest and ddf files.  If you have a large deployment it can take ages to handcode these files.

    I'm looking to post an article on my blog about this soon http://dhunter-thinkingoutaloud.blogspot.com/.

    Hope this helps

    Dave


    My SharePoint Blog http://www.davehunter.co.uk
  •  08-10-2007, 9:52 AM 4752 in reply to 4747

    Re: How to automate WSP file creation?

    Excellent! Thanks for posting about these Dave they look really useful!

    We're still hand cranking our DDF files but now have enough experience with them that it's become boring! "Vetting", as you say, is the way to go I think. We have quite varied projects e.g. one for webparts, one for lists, one for components, one for webservices etc.... so I'll be interested to see whether we can use these scripts for everything? I'm part way through writing a Blog article about build processes so I think I'll try to factor this in....

    Cheers

    Chris Hines


    http://www.chrishines.com/techblog
  •  11-05-2008, 12:10 PM 14964 in reply to 4752

    Re: How to automate WSP file creation?

    Hi
    I'm deploying a number of features with a WSP file that was built from a ddf
    file and then compiled using Makecab.
    Does anyone know how to include registry entries and extra web.config keys
    to the solution?
    A simple yes/no for each would be great but any example files would be fantastic.
    Thanks
    Andy
  •  11-07-2008, 2:05 PM 15019 in reply to 14964

    Re: How to automate WSP file creation?

    Hi Andy,

    You can write a SPFeatureReceiver that uses the SPWebConfigModification class, theres a good post here http://www.wagnerlive.com/mark/Lists/Posts/Post.aspx?ID=32.

    As for registry keys I don't think its possible to include in a WSP.  You could write a MSI that creates the keys and installs, deploys the solution.

    What are you using registry keys for?

    Thanks

    Dave


    My SharePoint Blog http://www.davehunter.co.uk
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems