Once a solution has been added to SharePoint, then there's no apparent way to download it. Using the SharePoint object model we can easily download a wsp using the 'SaveAs' method.
The C# code below illustrates how to download all of the solutions in the farm with just a few lines.
SPSolutionCollection solutionCollection = SPFarm.Local.Solutions;
foreach (SPSolution solution in solutionCollection)
{ SPPersistedFile wsp = solution.SolutionFile;
SaveWSP(wsp);
}
private void SaveWSP(SPPersistedFile wsp)
{ if (wsp != null)
{
string fileName = Path.Combine(
@"c:\temp\wspdownloads",
wsp.Name);
if (System.IO.File.Exists(fileName))
System.IO.File.Delete(fileName);
wsp.SaveAs(fileName);
}