What is a WSP file? Explain the installation process.
Farm solution installation in Microsoft SharePoint is a system that enables developers to package custom farm solutions and administrators to deploy those farm solutions in a straightforward, safe and consistent manner. Specifically, installation refers to the process of uploading and unpacking solution packages (.wsp files) to front-end web servers and deploying the contents. Web Solution Package is a
cabinet file that contains assemblies, resource files, features, images,
application pages, site definitions etc. into single file.
When the solution is being added it is stored in the Farm Solution Store table in the farm's configuration database.
When adding a farm solution to the store, the contents of the solution file are validated against an .xsd file to verify that the files contained in it comply with the SharePoint Foundation schemas. If the verification fails, an error message is returned. If the verification succeeds, the process of adding the farm solution continues.
There are two methods of adding a solution to the Farm Solution Store, which are as follows:
- The first one is through using the stsadm command from within the Management Shell, one can also the Central Admin to deploy the solution after it has been added.
- Using the Object Model, one needs to call the Add method of the SPFarm.Solution class and then call the SPSolution.Deploy method to deploy the solution.
The steps in installing a farm solution are as follows:
- Adding - in this process the solution is added to the farm solution store in the configuration database, one needs to have the farm administrator's privilege in order complete the process. It cannot be done from the Central admin it can either be done from the Management Shell or using the Object Model.
- Deploying - in this process the solution is unpacked and the files are copied to the respective locations, this can done either from the Central Admin, Management Shell or using the Object Model. For this process the user needs the farm administrator's privilege. The deployment step for a farm solution creates a timer job. This timer job is used by the timer service on each web server in the server farm. The timer job also uses the SharePoint Foundation Administrative web service to access appropriate privileges to deploy solution files to each computer, so both services must be running on all servers for the deployment to succeed.
Initially, the package manifest (The description the WSP file is stored in the file "manifest.xml") is parsed to find assemblies, application pages, JavaScript, and other files that are not part of a Feature. These are copied to the locations specified in the manifest. All files contained within a Feature are copied to the Feature directory, a subdirectory of %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\FEATURES. After solution files are copied to the target computers, a configuration reset is scheduled for all front-end web servers; the reset then deploys the files and restarts Internet Information Services (IIS).For e.g. the user control files (.ascx) are copied to the location %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\ControlTemplates subfolder, assemblies are deployed to the global assembly cache or to a web application's \bin folder and if there are Features in the farm solution, they are copied to a subfolder of %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\FEATURES and installed in the Feature Gallery of the farm, web application, site collection, or website, depending on the scope of the Feature. - Activating Feature - Features must be activated before they can be used, so activating becomes a third step of installation for solutions that contain Features. Features can contain content types, controls, custom actions, custom fields, files, workflows, list instances, list templates, event receivers, and document converters; although some of these cannot be included in certain scopes.
Comments
Post a Comment