Monday, April 19, 2010

Extract WSP packages with WSPBuilder

It is possible to extract (unpack) the contents of a WSP package into the file system with use of WSPBuilder. This function currently only supports a full extract of everything, so you have to pick what you need afterwards. The command syntax is:

WSPBuilder.exe -o extractwsp
-Filename : (Optional) Define the WSP file to extract. Default is the last created WSP file from the current directory.
-TargetPath : (Optional) Defines the target path to extract the wsp file in. Default is the current directory.
-Overwrite : (Optional) Overwrite existing files.


WSPBuilder.exe –o extractwsp –filename mypackage.wsp –overwrite true

Warning! I have not fully tested the ExtractWSP functionality in every possible scenario, so please understand.

The function is supported from WSPBuilder version and forward, including the WSPBuilder 2010 versions.


Stephen said...

Incase you are looking for bugs/feedback on this feature...:

I gave this a try with the wsp distributed by Microsoft for Scrum For Team System 1.0.

It output a solutionid.txt with a GUID and a wsp with the name of the folder that had the wsp I was trying to extract (Microsoft.TeamFoundation.SharePoint.Scrum.wsp)

Anonymous said...

I tried this with version and it is not supported. Instead of extracting the wsp, a new wsp is created. The -o extractwsp option is not mentioned in the help text.