您的位置:首页 > Web前端

安装、部署和卸载解决方案

2010-06-21 23:26 429 查看
最近工作中需要一个feature,在文档库中每个项目的下拉列表中添加一个菜单项,而且要求打包成wsp,我写了两个bat文件,一个用于安装部署,一个用于卸载。

1、安装部署:

@echo off

set /p wspLocation = Please input wsp file location:

set /p siteUrl = Please input site url:

cd C:\

cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN

stsadm.exe -o addsolution -filename %wspLocation%

stsadm -o deploysolution -name myfeature.wsp -url %siteUrl% -immediate -allowCasPolicies

stsadm -o execadmsvcjobs

stsadm -o activatefeature -name MyFeature -url %siteUrl% -force

注:myfeature.wsp是解决方案的名称,MyFeature是此feature所在目录。此feature只部署在指定的某个站点集中,所以需要先指定wsp文件的位置及需要部署此解决方案的站点集地址,也因此而需要-allowCasPolicies,若要部署到所有站点集时用-allowGacDeployment

2、卸载:

@echo off

set /p siteUrl = Please enter site url:

cd C:\

cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN

stsadm -o retractsolution -name myfeature.wsp -url %siteUrl% -immediate

stsadm -o execadmsvcjobs

stsadm -o deletesolution -name myfeature.wsp
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐