Sample Batch File for Installing SharePoint Solution

I’ve pieced together this batch file as I find I’m always reinventing the wheel, when it comes to installing SharePoint Solutions that don’t come with an installer (setup.exe type deal).

 

So, here it is, ready to be used by you (and easy to find, by me…) 🙂

@ECHO OFF
SET PATHTOSTSADM=C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12BIN
 
REM *** The following variables will be unique for your purpose ***
SET SITE_URL="http://blog.brainlitter.com"
SET PATHTOSOLUTION=C:Program FilesTim HeuerRSS FeedReader Web Part
SET SOLUTION_NAME=SmilingGoat.SharePoint.WebParts.Rss.wsp
REM *** End Variables ***
 
REM stsadm -o upgradesolution -name %SOLUTION_NAME% -filename %SOLUTION_NAME% -local -allowgacdeployment
 
REM If changes are not reflected by using upgradesolution, retract and delete the solution, then re-add/deploy
REM (Run these commands in a dos window so you can pause and wait for the retract to complete, otherwise the
REM deletesolution will fail
REM ----------------------------------------------------------------------------
REM stsadm -o retractsolution -name %SOLUTION_NAME% -url %SITE_URL% -immediate
REM pause
REM stsadm -o deletesolution -name %SOLUTION_NAME%
 
REM Use the following addsolution and deploysolution commands for the initial deployment, then
REM comment them out and use the above upgradesolution command
REM ----------------------------------------------------------------------------
"%PATHTOSTSADM%stsadm.exe" -o addsolution -filename "%PATHTOSOLUTION%%SOLUTION_NAME%"
"%PATHTOSTSADM%stsadm.exe" -o deploysolution -name %SOLUTION_NAME% -allowGacdeployment -local -url %SITE_URL%
 
ECHO.
ECHO Don't forget your IISRESET!!
ECHO.
pause