Feb 16, 2010

Modify SharePoint Solution Package (WSP) without rebuilding

Recently a SharePoint group memeber asked how to modify a text file inside a wsp without knowing source files's folder structure (i.e, it can't simply rebuilt by wspbuilder). Initially i thought it can be done just by unzip and zip again wsp file. It turns out even though wsp can be extracted by winzip, it can't be zipped back (the resulting wsp can't be added).

The right and simple way to do this is to use winzip extract and then use Cab SDK (download here) command such as:
cabarc -r -p -P winzip n bcs.wsp winzip\*.*

This works for both MOSS 2007 and SharePoint 2010 farm solution, but it doesn't work for SharePoint 2010 sandbox solution. I will update when I find a way to do it for sandbox solution as well (wait for 2010 RTM)