安裝部署MOSS特性的批處理文件

安裝部署解決方案的批處理文件

@echo off
title 安裝MOSS工作流
color 0E
echo. // 安裝使用VS.NET開發的MOSS工作流
echo. // 深圳㊣利民
echo. // 版本:v1.0.080321

echo.

if not exist "%CommonProgramFiles%\Microsoft Shared\Web Server Extensions\12\BIN\STSADM.EXE" goto end
set stsadm="%CommonProgramFiles%\Microsoft Shared\Web Server Extensions\12\BIN\STSADM.EXE"

set /p site=請輸入要部署的網站:
set /p solution=請輸入解決方案名稱(.wsp文件):
set /p feature=請輸入特性名稱(.wsp中存放feature.xml文件的文件夾名稱):

echo. 正在停用特性%feature%...
%STSADM% -o deactivatefeature -filename %feature%\feature.xml -url %site%  -force
echo. 正在刪除特性%feature%...
%STSADM% -o uninstallfeature   -filename %feature%\feature.xml  -force
echo. 正在撤銷解決方案%solution%...
%STSADM% -o retractsolution    -name %solution%    -local
echo. 正在刪除解決方案%solution%...
%STSADM% -o deletesolution     -name %solution%    -override

echo. 正在安裝解決方案%solution%...
%STSADM% -o addsolution        -filename %solution%
echo. 正在部署解決方案%solution%...
%STSADM% -o deploysolution     -name %solution%             -local                  -allowGacDeployment  -allcontenturls

echo. 正在安裝特性%feature%...
%STSADM% -o installfeature     -filename %feature%\feature.xml  -force
echo. 正在啟用特性%feature%...
%STSADM% -o activatefeature    -filename %feature%\feature.xml  -url %site%  -force

echo.
echo 正在重新啟動IIS...
iisreset

echo.
echo 安裝完成

goto quit

:end
echo stsadm.exe文件不存在
goto quit

:quit

pause


 

posted on 2008-10-10 16:53  晃晃悠悠  阅读(235)  评论(0)    收藏  举报