安装、部署和卸载解决方案
最近工作中需要一個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
轉載于:https://blog.51cto.com/joycode/337118
總結
以上是生活随笔為你收集整理的安装、部署和卸载解决方案的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 黄聪:如何使用CodeSmith批量生成
- 下一篇: 《Windows核心编程》---邮槽通信