Automating the install of the Application Templates for SharePoint

by Kindler Chase 20. January 2008 00:00

As I was manually installing the Fab 40 Application templates and sites for SharePoint 2007 in my development environment, I did what most lazy developers do: What could I do to automate the process of installing all the templates? Then it hit me. Why not just iterate through the file system and call the stsadm.exe command line for each file.

And as the sharing SharePoint developer I am, I decided to post my installation scripts for all other lazy developers.

Automating the installation of the WSP and STP templates

To install the WSP and STP templates to your SharePoint site:

  1. Unzip the templates to either a directory on your server or a file share you can access from your server.
  2. Save the following scripts as a .bat file to the same directory you unzipped the templates into.
  3. Simply double click each .bat file and watch the automated install which should take no more than a couple of minutes for each .bat file.

The following code snippets can be downloaded at the bottom of this post.

install-wsp-templates.bat

The following will install the .WSP templates:

  • AbsenceVacationSchedule.wsp
  • ApplicationTemplateCore.wsp
  • BudgetingTrackingMultipleProjects.wsp
  • BugDatabase.wsp
  • CallCenter.wsp
  • ChangeRequest.wsp
  • ComplianceProcessSupport.wsp
  • ContactsManagement.wsp
  • DocumentLibraryReview.wsp
  • EventPlanning.wsp
  • ExpenseReimbursementApproval.wsp
  • HelpDesk.wsp
  • InventoryTracking.wsp
  • ITTeamWorkspace.wsp
  • JobRequisition.wsp
  • KnowledgeBase.wsp
  • LendingLibrary.wsp
  • PhysicalAssetTracking.wsp
  • ProjectTrackingWorkspace.wsp
  • RoomEquipmentReservations.wsp
  • SalesLeadPipeline.wsp 
   1:  :: Kindler Chase 2008-01-15 www.RareGrooveRider.com
   2:  :: Installation of all application templates
   3:  :: Be sure to run this script from the location the application templates reside.
   4:   
   5:   
   6:  @ECHO OFF
   7:   
   8:  ECHO This will install all the WSS 3.0 WSP Application templates.
   9:  ECHO.
  10:  ECHO Be sure this script resides in the same directory 
  11:  ECHO as the application templates!!!
  12:  ECHO.
  13:  PAUSE
  14:  CLS
  15:   
  16:  SET STS="C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm.exe"
  17:   
  18:  FOR %%G IN (*.wsp) DO (
  19:  ECHO %%G start
  20:  %STS% -o addsolution -filename %%G
  21:  %STS% -o deploysolution -name %%G -allowgacdeployment -immediate
  22:  ECHO %%G end
  23:  ECHO.
  24:  ECHO.
  25:  )
  26:   
  27:  ECHO Copying app bin content.
  28:  ECHO.
  29:   
  30:  %STS% -o copyappbincontent
  31:   
  32:  ECHO.
  33:  ECHO App bin content complete.
  34:  ECHO.
  35:  ECHO.
  36:  ECHO Executing jobs.
  37:  ECHO.
  38:   
  39:  %STS% -o execadmsvcjobs
  40:   
  41:  ECHO.
  42:  ECHO Jobs complete.
  43:  ECHO.
  44:  ECHO.
  45:  ECHO That's all folks!
  46:  ECHO.
  47:   
  48:  PAUSE
  49:   
  50:  EXIT

install-stp-tempaltes.bat

The following will install all the .STP templates:

  • BoardDirectors.stp
  • BusinessPerformance.stp
  • CaseManagement.stp
  • ClassroomManagement.stp
  • ClinicalTrial.stp
  • CompetitiveAnalysis.stp
  • DiscussionDatabase.stp
  • DisputedInvoice.stp
  • EmployeeActivities.stp
  • EmployeeBenefits.stp
  • EmployeeTraining.stp
  • EquityResearch.stp
  • ManufacturingProcess.stp
  • MarketingCampaign.stp
  • NewStoreOpening.stp
  • ProductPlanning.stp
  • RequestForProposal.stp
  • SportsLeague.stp
  • TeamWorkSite.stp
  • TimecardManagement.stp
   1:  :: Kindler Chase 2008-01-15 www.RareGrooveRider.com
   2:  :: Installation of all application templates
   3:  :: Be sure to run this script from the location the application templates reside.
   4:   
   5:   
   6:  @ECHO OFF
   7:   
   8:  ECHO This will install all the WSS 3.0 STP Application templates.
   9:  ECHO.
  10:  ECHO Be sure this script resides in the same directory 
  11:  ECHO as the application templates!!!
  12:  ECHO.
  13:  PAUSE
  14:  CLS
  15:   
  16:  SET STS="C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm.exe"
  17:   
  18:  FOR %%G IN (*.stp) DO (
  19:  ECHO %%G start
  20:  %STS% -o addtemplate -filename %%G -title %%G
  21:  ECHO %%G end
  22:  ECHO.
  23:  ECHO.
  24:  )
  25:   
  26:  ECHO.
  27:  ECHO Ready to reset IIS.
  28:  PAUSE
  29:   
  30:  iisreset -noforce
  31:   
  32:  ECHO.
  33:  ECHO.
  34:  ECHO That's all folks!
  35:  ECHO.
  36:   
  37:  PAUSE
  38:   
  39:  EXIT

You now have 40 new site templates to play with on your SharePoint site.

Enjoy!

install-wsp-templates.bat (934.00 bytes)

install-stp-templates.bat (733.00 bytes)

Comments

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen
Log in

Kindler Chase

Kindler Chase
This is SharePoint's world. I'm only living in it.

Your host, on the right, with my better half, Sadi.