Friday, December 23, 2011

Create BAT File in MOSS 2007 / SharePoint 2007


To ease the deployment process, create a batch file called InstallAll.bat in the folder that contains the FormDataWorkflow.sln Visual Studio solution file. Add the following code to the InstallAll.bat file.
iisreset /stop

"%programfiles%\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" -uf FormDataAspxPages
"%programfiles%\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" -if FormDataASPXPages\bin\Debug\FormDataAspxPages.dll

"%programfiles%\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" -uf FormDataWorkflow
"%programfiles%\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" -if FormDataWorkflow\bin\Debug\FormDataWorkflow.dll

iisreset /start

copy /Y "FormDataAspxPages\FormDataAssocForm.aspx" %SystemDrive%"\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS"
copy /Y "FormDataAspxPages\FormDataInitForm.aspx" %SystemDrive%"\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS"

mkdir  %SystemDrive%"\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES\FormDataWorkflow"

copy "FormDataWorkflow\Feature.xml" %SystemDrive%"\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES\FormDataWorkflow"
copy "FormDataWorkflow\workflow.xml" %SystemDrive%"\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\FEATURES\FormDataWorkflow" 

pushd "%programfiles%\common files\microsoft shared\web server extensions\12\bin"

stsadm -o deactivatefeature -filename "FormDataWorkflow\feature.xml" -url http://localhost -force
stsadm -o uninstallfeature -filename "FormDataWorkflow\feature.xml" -force

stsadm -o installfeature -filename "FormDataWorkflow\feature.xml" -force
stsadm -o activatefeature -filename "FormDataWorkflow\feature.xml" -url http://localhost -force

popd

PAUSE

No comments:

Post a Comment