none
How to Edit Existing WSP RRS feed

  • Question

  • If you only have the wsp file, is there a way to open it up in Visual Studio 2007 and edit it?  I do have WSPBuilder installed as well.  I'm asking because I received a wsp from a vendor, but when adding the solution through stsadm I received an error due to the manifest file.  I'd like to be able to fix the error and recompile instead of waiting on them...

    TIA.

    Saturday, February 27, 2010 8:55 PM

Answers

  • Carl

    If you want to check end modify the contents of the .wsp package, you simply rename the .wsp file to .cab and open it.

    Let me know it works for you not.


    Ashish Kanoongo, MCP, MCSD, MCTS
    Sunday, February 28, 2010 12:37 AM

All replies

  • Carl

    If you want to check end modify the contents of the .wsp package, you simply rename the .wsp file to .cab and open it.

    Let me know it works for you not.


    Ashish Kanoongo, MCP, MCSD, MCTS
    Sunday, February 28, 2010 12:37 AM
    1. Rename WSP file to CAB and extract all the files
    2. Modify the necessary files
    3. Rebuild the correct directory structure for the solution
    4. Copy the files into that directory structure (in the right place)
    5. Create a DDF file indicating name and location of all files to be in WSP file
    6. Run MakeCab using created DDF file to create cab, then rename cab to WSP

    MOSS Lahoti

    • Proposed as answer by PANKAJLAHOTI Wednesday, June 6, 2012 1:12 PM
    Wednesday, June 6, 2012 1:11 PM
  • 1. Extract WSP using 7 Zip

    7 Zip is a free tool that will allow you to extract your WSP files AND the directory structure it was built with. There are probably other zip tools that will do this as well, I was just not able to do it with Windows. Regardless, use a tool that let’s you extract the files and directory structure from the WSP file. 

    2. Modify your files

    Okay, now go in and modify the files you need to modify. Make whatever changes you need to make. Be VERY careful if messing with the XML files though…all kinds of nastiness there if you screw something up.

    3. Download and use DDFGenerator from CodePlex

    So, my new friend on Twitter @tigertoy pointed me to a project on CodePlex called DDFGenerator.  It’s simply an executable. All you have to do is download this executable, execute it from the command line and give it the Path to the directory structure created by 7 Zip (or whatever program you used). This will generate your DDF file for you.

    One quick note, the DDF Generator does not put an entry in the DDF to set the WSP file name. So, make your life easier, open up the .DDF file and add the following line along with the ther .Set lines:

    .Set CabinetNameTemplate=SolutionName.WSP

    This will make sure your WSP file is named properly with the correct extension. If you don’t do this it will create a cab file called “1.cab” when you run MakeCab.exe in the next step and you will have to rename it to your solution name. Not a big deal, just something to keep in mind.

    4. Run MakeCab to create .CAB File

    Now all you have to do is run MakeCab to generate your WSP file using the DDF you generated. This also will be run from the command line and will look something like:

    MakeCab.exe /F <ddfFilename.ddf>

    After you run the above command, you will have your WSP file which you can go deploy


    MOSS Lahoti

    • Proposed as answer by Sagir Kazi Tuesday, June 12, 2012 10:20 PM
    Wednesday, June 6, 2012 1:15 PM
  • Thanks PANKAJLAHOTI for the detailed explanation. It worked for me to edit MOSS wsp to SP 2010.

    Regards, Sagir R Kazi

    Tuesday, June 12, 2012 10:22 PM
  • There should not be a need to open the manifest file in Visual Studio.  If the contents of the WSP need modified, the .wsp can be extracted using WSPBuilder from codeplex (http://wspbuilder.codeplex.com), any content files can be modified (.aspx, .xml, .ascx, .master, etc.), and then the WSP can be repackaged.  You can find detailed instructions on the commands to run from the command prompt at: http://www.itmonotony.com/Lists/Posts/Post.aspx?ID=40

    Wednesday, June 20, 2012 2:41 AM
  • Check the generated ddf file for blanks in the references to your files. If you used filenames or path names with blanks like sample\required components\ you must put them in quotes. Like that "sample\required components\".

    Otherwise makecab will throw file not found errors.

    Monday, July 23, 2012 10:15 AM
  • SharePoint 2010 .wsp file will be work on SharePoint 2013 by using this method?


    Jey

    • Proposed as answer by Jeym Thursday, April 4, 2013 10:55 AM
    Tuesday, April 2, 2013 12:42 PM
  • Thanks for the nice instructions.

    I ran into the same issue charlybravo did below.  Of course I didn't scroll down to see his note before working through it myself.  I posted an issue to DDFGenerator so it might get fixed.

    As noted below depending on what you're changing you may need to edit the manifest.xml or Elements.xml / Feature.xml files in the folders.  You may also want to change the Name and Title in your WebTemplate files.

    Tuesday, September 15, 2015 6:52 PM