Installation
Using Solution file & setup batch file
The recommended procedure is to download two files. A Solution File which is
AMFilteredSearch.wsp and and a Setup Batch File which is
setup.bat.
A complete list of options for the setup.bat file can be obtained by typing
setup /hin a command prompt window (in the same directory where the setup.bat file has been saved)
First Time Install
In order to install, simply place both files in the same directory on the SharePoint server (the location is unimportant) and run the following command as Administrator (or as the user with administrative rights on your SharePoint server):
setup.bat /installor simply
setup (/install is the default)
Then make sure that you recycle the application pool or perform an IISRESET (see
here for detailed instructions).
Updating a previous version
As before, place both the WSP file and the setup batch file in the same directory on your SharePoint server. However, if a previous version of the solution is installed, it will need to be uninstalled first.
Note that you do not have to remove the web part from pages that it has been used on. After the uninstall and re-install process, those web parts will simply be updated to the new version. The commands to perform are:
setup.bat /uninstall
setup.bat /install
Again, make sure that you recycle the application pool or perform an IISRESET (see
Recycle App Pool for detailed instructions).
Additional Options
By default, the site collection URL used will be
http://localhost. You can specify a different URL if necessary by passing the
/siteurl url option to the setup command.
Equally, you may specify a web url by passing the
/weburl url option. By default the web url is
http://localhost.
Again, make sure that you recycle the application pool or perform an IISRESET after installing a new version (see
here for detailed instructions).
Using STSADM
The setup.bat file uses a command line tool called
STSADM to install the solution package. This is usually found here:
C:\Program Files\Microsoft Shared\web server extensions\12\BIN\stsadm.exeIf you have not already done so, add
C:\Program Files\Microsoft Shared\web server extensions\12\BIN to the PATH environment variable for your administrative user account on the SharePoint server. We will assume that
stsadm.exe is in your path.
Checking to see if the solution is already installed
stsadm -o enumsolutions | moreThis will list all of the installed solutions and their status. They should be listed in alphabetical order, so you are looking for a section like this:
<Solution Name="amfilteredsearch.wsp">
<Id>4920cec3-9bc6-4f9f-9cd6-a24b614bb5a4</Id>
<File>AMFilteredSearch.wsp</File>
<Deployed>TRUE</Deployed>
<WebApplicationSpecific>TRUE</WebApplicationSpecific>
<ContainsGlobalAssembly>TRUE</ContainsGlobalAssembly>
<ContainsCodeAccessSecurityPolicy>FALSE</ContainsCodeAccessSecurityPolicy>
<Deployment WebApplication="http://rshdev01/" />
<LastOperationResult>DeploymentSucceeded</LastOperationResult>
<LastOperationTime>11/14/2010 9:58 PM</LastOperationTime>
</Solution>
If this exists (and the LastOperationResult was DeploymentSucceeded) then the solution is installed.
First Time Install with STSADM
Note that to a large extent, I am simply echoing the process in the
setup.bat file.
Step 1: Add the solution to SharePoint:
stsadm -o addsolution AMFilteredSearch.wspStep 2: Deploy the solution (URL is the target
web url):
stsadm -o deploysolution -name "AMFilteredSearch" -local -allowGacDeployment -url http://localhostStep 3: Activate the feature:
stsadm -o activatefeature -name "AMFilteredSearch" -url http://localhost
Updating a previous version using STSADM
Step 1: Deactivate the feature (URL is the target
site url)
stsadm -o deactivatefeature -name "AMFilteredSearch" -url http://localhost -forceStep 2: Uninstall the feature
stsadm -o uninstallfeature -name "AMFilteredSearch" -force Step 3: Retract the solution (URL is the target
web url)
stsadm -o retractsolution -name "AMFilteredSearch" -local -url http://localhost Step 4: Delete the solution
stsadm -o deletesolution -name "AMFilteredSearch"Step 5: Add the new version of the solution to SharePoint:
stsadm -o addsolution AMFilteredSearch.wspStep 6: Deploy the new solution (URL is the target
web url):
stsadm -o deploysolution -name "AMFilteredSearch" -local -allowGacDeployment -url http://localhostStep 7: Re-activate the feature:
stsadm -o activatefeature -name "AMFilteredSearch" -url http://localhostAgain, make sure that you recycle the application pool or perform an IISRESET after installing a new version (see
here for detailed instructions).
Compiling from source
The zipped source download contains a Visual Studio solution file for Visual Studio 2008. If you have Visual Studio 2008 or 2010, you should be able to unzip the source code to your favorite location and open the solution file. Note, however, that if you are not developing on a server with SharePoint 2007 installed, then you may need to copy the relevant dlls from a SharePoint 2007 server or the solution won't build (and you'll need to re-add them as references, because they will be in different locations).
Also, if you do not have Visual Studio Extensions for WSS installed you may also run into problems.
If you are still using VS2005 then you can still build the project, but it may be a bit more manual. I would suggest the following:
- Install VseWSS 1.1 for VS2005
- Create a new web part project
- Make a copy of the Guid that the template supplies for you
- Overwrite the "WebPart1.cs" file with the contents of "AMFilteredSearch.cs"
- Change the Guid back to your Guid (if you intend modifying the code for your own use)
- Add the remaining source code files and images to the project
- Cross your fingers and Build!