So, you’ve developed a SharePoint solution, contains custom WebParts, Content Types, List Definitions, etc. It’s time to add the solution to SharePoint. Remember this sequences of commands?
stsadm -o addsolution -filename YourSolution.wsp
stsadm -o deploysolution –name YourSolution.wsp -url http://deployserver -immediate -allowGacDeployment -allowCasPolicies -force
It’s quite lengthy process, right? Not to mention if you have to build a script to check system requirement (let’s say you want to specifically deploy to MOSS/SharePoint Server, instead of WSS/SharePoint Foundation), to check whether the SharePoint timer is running, etc. You’ll feel quite pain.
Luckily, for WSS 3.0 and MOSS 2007, there is a very useful project in CodePlex called SharePoint Solution Installer. However, let’s say you’ve done with WSS 3.0/MOSS 2007, and you are dynamic person like me and want to move on to SharePoint 2010. What’s the option for solution installer to install to SharePoint 2010? Unfortunately, you can’t use that SharePoint Solution Installer to deploy solution to SharePoint 2010.
What a coincidence, I have the same problem. After searching here and there with no luck, I grab that SharePoint Solution Installer’s source code from here. Download the latest version/changeset, and start to playing around. I’ve manage to make it work with SharePoint 2010 RC, looks like won’t work with the Beta, and don’t know whether it will work with RTM. Download the source code (in Visual Studio 2010) and the binary in this post attachment (SharePoint Solution Installer Binary.zip), or from these links:
Inside binary folder, you’ll find two main files: Setup.exe and Setup.exe.config,among other resource files.
How to use it?
Here’s step by step guide to deploy SharePoint 2010 solution (built using VS 2010) to SharePoint Foundation 2010. You’ll find the same way for deployment to SharePoint Server 2010.
1. Make sure your solution is built successfully. You know how to do that, right? :)
2. Make sure you’ve configure Package and Feature. Right click to Project name and click Package.
If all OK, you’ll find YourSolution.wsp (YourSolution is your solution/project name) in bin\Debug or bin\Release folder under project folder.
3. Put YouSolution.wsp file in a same folder together with Setup.exe and Setup.exe.config (the two files inside SharePoint Solution Installer binary folder, remember?)
4. Adjust Setup.exe.config so it will look like this.
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="BannerImage" value="Default"/>
<add key="LogoImage" value="None"/>
<add key="FeatureScope" value="Site"/>
<add key="SolutionId" value="7da37f84-b7e1-40f6-a7c6-15c8279817c8"/>
<add key="FeatureId" value="737ab42b-22b0-4f72-ad9d-896dc33f8f50"/>
<add key="SolutionFile" value="YourSolution.wsp"/>
<add key="SolutionTitle" value="My Solution"/>
<add key="SolutionVersion" value="1.0.0.0"/>
<add key="UpgradeDescription" value="Upgrades {SolutionTitle} on all frontend web servers in the SharePoint farm."/>
<add key="RequireDeploymentToCentralAdminWebApplication" value="false"/>
<add key="RequireDeploymentToAllContentWebApplications" value="false"/>
<add key="DefaultDeployToAdminWebApplications" value="false"/>
<add key="DefaultDeployToContentWebApplications" value="false"/>
</appSettings>
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>
Adjust: SolutionId, FeatureId, SolutionFile, SolutionTitle to fit your need. For more detail about the settings, consult to the documentation at http://sharepointinstaller.codeplex.com/
5. Run Setup.exe. You’ll run through following wizard.
Welcome screen
System checking. As you can see it will check whether SharePoint Foundation 2010 is installed, among other things.
Choose to which Web Apps/Site collections you want to install the solution. This screen will show if you set FeatureScope to Site in Setup.exe.config.
Installation success. Feature is automatically activated.
That’s it. Your solution is added, deployed, and feature is activated. Good luck trying.