SharePoint Development with Windows Server 2008 and IIS 7.0 - install.bat sample
Here is a sample batch file to help with your SharePoint development on Windows Server 2008 and IIS 7.0.
@SET TEMPLATEDIR="c:\program files\common files\microsoft shared\web server extensions\12\Template"
@SET STSADM="c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm"
@SET GACUTIL="C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe"
@SET APPCMD="c:\windows\system32\inetsrv\appcmd.exe"
Echo Installing YOURASSEMBLY.dll in GAC
%GACUTIL% -if bin\debug\YOURASSEMBLY.dll
REM You can also deploy to local bin folder of the Web Application, if you don't want or not allowed to use GAC
REM Echo Copying YOURASSEMBLY.dll to Web App Bin
REM xcopy /y bin\debug\YOURASSEMBLY.dll C:\inetpub\wwwroot\wss\VirtualDirectories\80\bin
Echo Copying files
xcopy /e /y TEMPLATE\* %TEMPLATEDIR%
Echo Installing feature
%STSADM% -o installfeature -filename YOURFEATURES\feature.xml -force
Echo Recycling Application Pool
%APPCMD% recycle APPPOOL "SharePoint - 80"
Notes:
- I have used Application Pool recycling instead of restarting IIS, which gives faster development/test cycles.
- In IIS 7.0, appcmd.exe replaces the script file named iisapp.vbs, so if you're still in IIS 6 (Windows Server 2003), then use the following instead:
cscript c:\windows\system32\iisapp.vbs /a "SharePointDefaultAppPool" /r
- I have used the Windows SDK gacutil.exe, cause I'm running Windows Server 2008 and Visual Studio 2008. If you're still using Visual Studio 2005, then you can find it here:
c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe
-AQ