The SharePoint Solution Deployer

Deploying Solutions can be a …. (fill in as you wish).

The SharePoint Solution Deployer offers a great opportunity to writing your own scripts. The existing functionality should match your needs to deploy SharePoint Solutions. If not, the “framework” can be extended with custom Extensions or simple PowerShell code.

I’ve written two Extensions, which let you enable and disable features upon deployments and reset files to their site definitions (aka ReGhost).

To be able to have different URLs for your dev-machine, staging and production farms, simply create additional XML-files and configure URLs there. The XML-file needs to be named with the hostname of the server, where you want start the deployment.

Example

The example shows two files within the Environment subfolder.

Default XML Configuration file (Default.xml)

<?xml version="1.0" encoding="utf-8" ?>
<SPSD Version="5.0.3.6439">
	<Configuration ID="Default">
		...
	</Configuration>

	<Environment ID="Default">

		<Variables ID="Default">
			<!-- Default values are for production. Change values in Hostname.xml file to your needs.-->
			<Variable Name="CentralAdministrationWebAppUrl">https://xxx:11111</Variable>
			<Variable Name="WebAppUrl">https://prod.sharepoint.local</Variable>
		</Variables>

		<PreRequisiteSolutions ID="Default">
			...
		</PreRequisiteSolutions>

		<Solutions ID="Default" Force="false" Overwrite="true">
			...
		</Solutions>
	</Environment>
</SPSD>

 Hostname.xml

The script will look if there is any XML file with the name “hostname.xml”

<?xml version="1.0" encoding="utf-8" ?>
<SPSD Version="5.0.3.6439">
	<Environment ID="Default">

		<Variables ID="Default">
			<!-- Default values are for production. Change values in Hostname.xml file to your needs.-->
			<Variable Name="CentralAdministrationWebAppUrl">https://xxx:22222</Variable>
			<Variable Name="WebAppUrl">https://dev.sharepoint.local</Variable>
		</Variables>
	</Environment>
</SPSD>

That’s it.

You can start the deployment with e.g. “Redeploy.bat” from the Rootfolder, no matter which farm you are on.