Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

This seems to me an uphill task in SharePoint but is it possible to deploy the WSPs via SharePoint features? For instance, if we activate a certain feature then some specific SharePoint solutions (WSPs) should be deployed on SharePoint farm.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Yes.

You need to get a reference to the solution object itself via SPFarm.Solutions.

Once you have the SPSolution object, call Deploy (SPSolution.Deploy()) to deploy it.

SPSolutionCollection (returned by SPFarm.Solutions): http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spsolutioncollection_members.aspx

SPSolution Members: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spsolution_members.aspx

share|improve this answer
add comment

This seems to me an unnecessarily confusing way of going about things. If you have a feature that depends on another solution I would recommend creating a solution dependency between the "dependency" solution and the solution that contains the dependent feature. Unfortunately that wasn't available in SP2007, so you may have to do something in your deployment script to achieve the same effect.

I realise this may mean deploying the solution before it is actually needed, but I think this is a small price to pay. If you don't do this there is a good chance that when you attempt to activate the feature it won't work.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.