Create Setup\Build file to add solution package to the SharePoint server

It would be much easier if you get the .wsp (or solution package) created and pushed into 12 hive’s BIN directory on just a build of your project, isn’t it. Well here is how you can do it in few steps

1. Create a folder “MyCustomFolder4wsp” in your project to hold the wsp package.
2. Create a empty file and name it as “”.
3. Add the below lines of code in your file

@SET MakeCabTool=makecab.exe

@SET WSP= MYwspName -> Name of .wsp file

@SET DESTDIR=”C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN”

@SET SPAdminTool=%CommonProgramFiles%\Microsoft Shared\web server extensions\12\BIN\stsadm.exe
if EXIST MyCustomFolder4wsp\%WSP%.wsp del MyCustomFolder4wsp\%WSP%.wsp
“%MakeCabTool%” /f MyddfFile.ddf /D CabinetNameTemplate=MyCustomFolder4wsp\%WSP%.wsp  -> provide name of your .dff file.
if EXIST MyCustomFolder4wsp\ del MyCustomFolder4wsp\
“%MakeCabTool%” /f MyddfFile.ddf /D CabinetNameTemplate=MyCustomFolder4wsp\
XCOPY /r /y MyCustomFolder4wsp\*.wsp %DESTDIR%

4.  Set the Project properties to execute the  “” on Build of the Project. See Image below


Post a Comment

Popular Posts